Skip to content

Commit

Permalink
Merge pull request #967 from alphagov/cross-domain-tracking-with-exis…
Browse files Browse the repository at this point in the history
…ting-tracker

Add linked domain tracking to Plan For Britain campaign
  • Loading branch information
boffbowsh authored Mar 27, 2017
2 parents 5a9f499 + 121b236 commit dc09775
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/assets/javascripts/analytics/init.js.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function() {
(function(global) {
"use strict";

// Load Google Analytics libraries
Expand All @@ -14,9 +14,16 @@
var analytics = new GOVUK.StaticAnalytics({
universalId: universalId,
cookieDomain: cookieDomain,
allowLinker: true,
govukTrackerGifUrl: '<%= asset_path "/static/a.gif" %>',
});

// Make interface public for virtual pageviews and events
GOVUK.analytics = analytics;
})();

if (global.ga) {
var ga = global.ga;
ga('require', 'linker');
ga('linker:autoLink', ['planforbritain.gov.uk']);
}
})(window);

0 comments on commit dc09775

Please sign in to comment.