Skip to content

Commit

Permalink
GA additions & one small(?) FxA param change.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetto committed Feb 11, 2015
1 parent b40cb5b commit 35124b0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions media/js/firefox/australis/growth-browser-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ if (typeof Mozilla == 'undefined') {
{
label: window.trans('later'),
style: 'link',
callback: this.options.cancelTour.bind(this)
callback: this.options.cancelTour.bind(this, 'Not Now')
},
{
label: window.trans('start'),
style: 'primary',
callback: this.options.startTour.bind(this)
callback: this.options.startTour.bind(this, "Let's Go")
}
];

// callback to postpone tour if user clicks the (x) button
var options = {
closeButtonCallback: this.options.cancelTour.bind(this)
closeButtonCallback: this.options.cancelTour.bind(this, 'Close')
};

// show the door-hanger info panel
Expand Down
14 changes: 10 additions & 4 deletions media/js/firefox/australis/growth-firstrun-test1.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
gaVariation = (showDoorhanger) ? 'a' : 'b';

window.gaTrack(['_setCustomVar', 7, 'first run tests', 'variation 2' + gaVariation, 2]);
window.gaTrack(['_trackEvent','/firstrun/ A/B Test', 'page load', 'variation 2' + gaVariation]);
window.gaTrack(['_trackEvent','/firstrun/ Optimization f35', 'page load', 'variation 2' + gaVariation]);

enableIframe = function() {
$ghosteryIframe.attr('src', $ghosteryIframe.attr('data-src'));
Expand All @@ -85,6 +85,8 @@
// temporary until FxA client supports broadcast of 'Signup' click
setTimeout(function() {
$fxaDelayedCTAs.addClass('visible');

window.gaTrack(['_trackEvent', '/firstrun/ Optimization f35', 'show addons','addons appear under signup form']);
}, 40000);
};

Expand All @@ -97,7 +99,7 @@

// conjure FxA lightbox
fxaClient.auth.signUp({
redirectUri: 'http://localhost:8000/', // TODO: must match creds? Seems to work on demo5 though...
redirectUri: window.location.protocol + '//' + window.location.hostname, // TODO: must match creds? Seems to not be checked by FxA though...
scope: 'profile',
state: '123456', // TODO: create real CSRF token
ui: 'lightbox',
Expand Down Expand Up @@ -180,7 +182,7 @@
// id is used for Telemetry
var tour = new Mozilla.BrowserTour({
id: $('#tour-page').data('telemetry'),
startTour: function() {
startTour: function(buttonCopy) {
// prepare FxA stuff
initFxA();

Expand All @@ -191,15 +193,19 @@
setTimeout(function() {
tour.doCloseTour();
}, 600);

window.gaTrack(['_trackEvent', '/firstrun/ Optimization f35', 'doorhanger button', buttonCopy]);
},
cancelTour: function() {
cancelTour: function(buttonCopy) {
tour.doCloseTour();

toggleDefaultContent(true);

if ($fxaOverlay) {
$fxaOverlay.fadeOut('fast');
}

window.gaTrack(['_trackEvent', '/firstrun/ Optimization f35', 'doorhanger button', buttonCopy]);
}
});

Expand Down
10 changes: 7 additions & 3 deletions media/js/firefox/australis/growth-firstrun-test2.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ function onYouTubeIframeAPIReady() {
gaVariation = (suppressDoorhanger) ? 'a' : 'b';

window.gaTrack(['_setCustomVar', 7, 'first run tests', 'variation 3' + gaVariation, 2]);
window.gaTrack(['_trackEvent','/firstrun/ A/B Test', 'page load', 'variation 3' + gaVariation]);
window.gaTrack(['_trackEvent','/firstrun/ Optimization f36', 'page load', 'variation 3' + gaVariation]);

tour = new Mozilla.BrowserTour({
id: $('#tour-page').data('telemetry'),
allowScroll: true,
suppressDoorhanger: suppressDoorhanger,
startTour: function() {
startTour: function(buttonCopy) {
// load iframe src's
enableIframes();

Expand All @@ -177,9 +177,13 @@ function onYouTubeIframeAPIReady() {

// mark tour as finished (but don't get rid of mask yet)
tour.tourHasFinished = true;

window.gaTrack(['_trackEvent', '/firstrun/ Optimization f36', 'doorhanger button', buttonCopy]);
},
cancelTour: function() {
cancelTour: function(buttonCopy) {
closeTour();

window.gaTrack(['_trackEvent', '/firstrun/ Optimization f36', 'doorhanger button', buttonCopy]);
}
});

Expand Down
2 changes: 1 addition & 1 deletion media/js/firefox/australis/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// should be removed after 2/24/2015
if (window.location.search.indexOf('f=34') > -1) {
gaTrack(['_setCustomVar' ,7, 'first run tests', 'variation 1', 2]);
gaTrack(['_trackEvent','/firstrun/ A/B Test', 'page load', 'variation 1']);
gaTrack(['_trackEvent','/firstrun/ Optimization f34', 'page load', 'variation 1']);
}

//Only run the tour if user is on Firefox 29 for desktop.
Expand Down

0 comments on commit 35124b0

Please sign in to comment.