Skip to content
Snippets Groups Projects
Commit 7559ea0b authored by Kevin Abel's avatar Kevin Abel
Browse files

Ensure analytics actually work

Was missing the Google Provided boilerplate code (ga.js).
Analytics module should call track page.
parent 98448aca
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@ module.exports = function (grunt) {
{
name: 'all',
create: true,
include: ['requireLib', 'require-css/css', 'main', 'jquery', 'analytics'],
include: ['requireLib', 'require-css/css', 'ga', 'main'],
exclude: ['require-css/normalize']
}
]
......
......@@ -31,6 +31,7 @@ define(['jquery'], function($) {
cookieDomain: unlDomain,
allowLinker: true
});
Plugin.callTrackPageview();
},
callTrackPageview: function(thePage, trackInWDNAccount){
......
// Google Analytics (ga.js) - legacy support
var _gaq = _gaq || [];
(function() {
var ga = document.createElement('script'); ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// Google Analytics (analytics.js)
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
......@@ -5,3 +5,10 @@ requirejs.config({
}
}
});
requirejs([
'jquery',
'analytics'
], function($, analytics) {
analytics.initialize();
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment