Update docs on funnelcakes, analytics, and a/b tests (#6272)

This commit is contained in:
Stephanie Hobson 2018-10-22 14:11:51 -07:00 коммит произвёл Paul McLanahan
Родитель c2d9e675d1
Коммит 03fa348e0b
5 изменённых файлов: 169 добавлений и 35 удалений

Просмотреть файл

@ -34,8 +34,8 @@ for the a/b test.
The view can handle the url redirect in one of two ways:
1. the same page, with some different content based on the `variation` variable
1. a totally different page
#. the same page, with some different content based on the `variation` variable
#. a totally different page
Content variation
~~~~~~~~~~~~~~~~~
@ -54,9 +54,10 @@ different.
Create the variant page like you would a new page. Make sure it is ``noindex``
and does not have a ``canonical`` url.
```
{% block canonical_urls %}<meta name="robots" content="noindex,follow">{% endblock %}
```
.. code-block:: jinja
{% block canonical_urls %}<meta name="robots" content="noindex,follow">{% endblock %}
Configure as explained on the `variation view <http://bedrock.readthedocs.io/en/latest/coding.html#variation-views>`_
page.
@ -68,13 +69,13 @@ Create a .js file where you initialize Traffic Cop and include that in the
experiments block in the template that will be doing the redirection. Wrap the
extra js include in a `switch <http://bedrock.readthedocs.io/en/latest/install.html#feature-flipping-aka-switches>`_.
```
{% block experiments %}
{% if switch('experiment-berlin-video', ['de']) %}
{{ js_bundle('firefox_new_berlin_experiment') }}
{% endif %}
{% endblock %}
```
.. code-block:: jinja
{% block experiments %}
{% if switch('experiment-berlin-video', ['de']) %}
{{ js_bundle('firefox_new_berlin_experiment') }}
{% endif %}
{% endblock %}
Switches
~~~~~~~~
@ -88,19 +89,19 @@ Including the ``data-ex-variant`` and ``data-ex-name`` in the analytics
reporting will add the test to an auto generated report in GA. The variable
values may be provided by the analytics team.
```
if(href.indexOf('v=a') !== -1) {
window.dataLayer.push({
'data-ex-variant': 'de-page',
'data-ex-name': 'Berlin-Campaign-Landing-Page'
});
} else if (href.indexOf('v=b') !== -1) {
window.dataLayer.push({
'data-ex-variant': 'campaign-page',
'data-ex-name': 'Berlin-Campaign-Landing-Page'
});
}
```
.. code-block:: javascript
if(href.indexOf('v=a') !== -1) {
window.dataLayer.push({
'data-ex-variant': 'de-page',
'data-ex-name': 'Berlin-Campaign-Landing-Page'
});
} else if (href.indexOf('v=b') !== -1) {
window.dataLayer.push({
'data-ex-variant': 'campaign-page',
'data-ex-name': 'Berlin-Campaign-Landing-Page'
});
}
Make sure any buttons and interaction which are being compared as part of the
test and will report into GA.
@ -118,10 +119,11 @@ Some things to consider checking:
- Locales excluded from the test call the correct (default) template.
A/B Test PRs that might have useful code to reuse
---
https://github.com/mozilla/bedrock/pull/5736/files
https://github.com/mozilla/bedrock/pull/4645/files
https://github.com/mozilla/bedrock/pull/5925/files
https://github.com/mozilla/bedrock/pull/5443/files
https://github.com/mozilla/bedrock/pull/5492/files
https://github.com/mozilla/bedrock/pull/5499/files
-------------------------------------------------
- https://github.com/mozilla/bedrock/pull/5736/files
- https://github.com/mozilla/bedrock/pull/4645/files
- https://github.com/mozilla/bedrock/pull/5925/files
- https://github.com/mozilla/bedrock/pull/5443/files
- https://github.com/mozilla/bedrock/pull/5492/files
- https://github.com/mozilla/bedrock/pull/5499/files

Просмотреть файл

@ -118,3 +118,38 @@ When a banner is dismissed:
'data-banner-dismissal': '1',
'event': 'in-page-interaction'
});
When doing a/b tests configure something like the following.
.. code-block:: javascript
if(href.indexOf('v=a') !== -1) {
window.dataLayer.push({
'data-ex-variant': 'de-page',
'data-ex-name': 'Berlin-Campaign-Landing-Page'
});
} else if (href.indexOf('v=b') !== -1) {
window.dataLayer.push({
'data-ex-variant': 'campaign-page',
'data-ex-name': 'Berlin-Campaign-Landing-Page'
});
}
Some notes on how this looks in GA
----------------------------------
``data-link-type="button"`` and ``data-link-name=""`` trigger a generic link
click with the following structure:
| Event Category: {{page ID}} Interactions
| Event Action: {{data-link-type}} click
| Event Label: {{data-link-name}}
Any element that has a ``data-button-name=""`` triggers an event with this
structure:
| Event Category: {{page ID}} Interactions
| Event Action: button click
| Event Label: {{data-button-name}}

96
docs/funnelcake.rst Normal file
Просмотреть файл

@ -0,0 +1,96 @@
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, You can obtain one at http://mozilla.org/MPL/2.0/.
.. _funnelcake:
=================
Funnel cakes and Partner Builds
=================
Funnel cakes
------------
In addition to being `an American delicacy <https://en.wikipedia.org/wiki/Funnel_cake>`_
funnel cakes are what we call special builds of Firefox. They can come with
extensions preinstalled and/or a custom first-run experience.
"The whole funnelcake system is so marred by history at this point I don't
know if anyone fully understands what it's supposed to do in all situations"
- pmac
Funnelcakes are configured by the Release Engineering team. You can see the
configs in the `funnelcake git repo <https://github.com/mozilla-partners/funnelcake>`_
Currently bedrock only supports funnelcakes for "stub installer platforms". Which
means they are windows only. However, funnelcakes can be made for all platforms
so `bedrock support may expand <https://github.com/mozilla/bedrock/issues/6251>`_.
We signal to bedrock that we want a funnelcake when linking to the download
page by appending the query variable `f` with a value equal to the funnelcake
number being requested.
.. code-block::
https://www.mozilla.org/en-US/firefox/download/thanks/?f=137
Bedrock checks to see if the funnelcake is configured (this is handled in the
`www-config repo <https://github.com/mozmeao/www-config/blob/master/waffle_configs/bedrock-prod.env>`_)
.. code-block:: bash
FUNNELCAKE_135_LOCALES=en-US
FUNNELCAKE_135_PLATFORMS=win,win64
Bedrock then converts that into a request to download a file like so:
Windows:
.. code-block::
https://download.mozilla.org/?product=firefox-stub-f137&os=win&lang=en-US
Mac (You can see the mac one does not pass the funnelcake number along.):
.. code-block::
https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US
Someone in Release Engineering needs to set up the redirects on their side to
take the request from here.
Places things can go wrong
~~~~~~~~~~~~~~~~~~~~~~~~~~
As with many technical things, the biggest potential problems are with people:
- Does it have executive approval?
- Did legal sign off?
- Has it had a security review?
On the technical side:
- Is the switch enabled?
- Is the variable being passed?
Partner builds
--------------
Bedrock does not have an automated way of handling these, so you'll have to
craft your own download button:
.. code-block:: html
<a href="https://download.mozilla.org/?product=firefox-election-edition&os=win&lang=en-US">
Download</a>
------------
Bugs that might have useful info:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1450463
- https://bugzilla.mozilla.org/show_bug.cgi?id=1495050
PRs that might have useful code:
- https://github.com/mozilla/bedrock/pull/5555

Просмотреть файл

@ -35,5 +35,6 @@ Contents
uitour
send-to-device
firefox-accounts
funnelcake
abtest
analytics

Просмотреть файл

@ -260,9 +260,9 @@ explicitly "off" in the environment. ``DEV`` defaults to "true" in local develop
To test switches locally:
1. Set ``DEV=False`` in your ``.env`` file.
1. Enable the switch in your ``.env`` file.
1. Restart your web server.
#. Set ``DEV=False`` in your ``.env`` file.
#. Enable the switch in your ``.env`` file.
#. Restart your web server.
To configure switches for a demo branch. Follow the `configuration instructions here <http://bedrock.readthedocs.io/en/latest/pipeline.html#configuration>`_.