This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add GA analytics tracking (bug 821921)
- Loading branch information
Showing
7 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
// Do this last- initialize the marketplace! | ||
|
||
define('developers', ['login', 'notification'], function() {}); | ||
define('developers', ['login', 'notification', 'tracking'], function() { | ||
// TODO: Nuke Webtrends once we're exclusively on GA. | ||
webtrendsAsyncInit(); | ||
}); | ||
require('developers'); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
// Do this last- initialize the marketplace! | ||
|
||
define('marketplace', ['login', 'notification', 'prefetch'], function() {}); | ||
define('marketplace', ['login', 'notification', 'prefetch', 'tracking'], function() { | ||
// Initialize analytics tracking. | ||
z.page.on('fragmentloaded', function(event, href, popped, state) { | ||
if (!popped) { | ||
// TODO: Nuke Webtrends once we're exclusively on GA. | ||
webtrendsAsyncInit(); | ||
|
||
// GA track every fragment loaded page. | ||
_gaq.push(['_trackPageview', href]); | ||
} | ||
}); | ||
}); | ||
require('marketplace'); | ||
|
||
$('#splash-overlay').addClass('hide'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
define('tracking', [], function() { | ||
// Copyright (c) 2012 Webtrends Inc. All rights reserved. | ||
window.webtrendsAsyncInit = function() { | ||
if (!('Webtrends' in window)) { | ||
return; | ||
} | ||
var dcs = new Webtrends.dcs().init({ | ||
dcsid: 'dcsk3ol5yvz5bdu9x8ttypqsj_3o6u', | ||
domain: 'statse.webtrendslive.com', | ||
timezone: 0, | ||
offsite: true, | ||
download: true, | ||
downloadtypes: 'xls,doc,pdf,txt,csv,zip,docx,xlsx,rar,gzip,xpi,jar', | ||
onsitedoms: 'marketplace.firefox.com', | ||
plugins: { | ||
//hm:{src:"//s.webtrends.com/js/webtrends.hm.js"} | ||
} | ||
}).track(); | ||
}; | ||
|
||
// GA Tracking. | ||
window._gaq = window._gaq || []; | ||
|
||
_gaq.push(['_setAccount', 'UA-36116321-6']); | ||
_gaq.push(['_trackPageview']); | ||
|
||
(function() { | ||
var ga = document.createElement('script'); | ||
ga.type = 'text/javascript'; | ||
ga.async = true; | ||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ||
// I am really not a fan of this - injects GA as the first script element. | ||
var s = document.getElementsByTagName('script')[0]; | ||
s.parentNode.insertBefore(ga, s); | ||
})(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters