Skip to content

Commit

Permalink
Use addLinkedTrackerDomain
Browse files Browse the repository at this point in the history
The analytics tracker now includes a method for adding a cross domain
analytics tracker. Use this instead. The implementation is identical.

See alphagov/govuk_frontend_toolkit#185
  • Loading branch information
fofr committed May 14, 2015
1 parent ec7d745 commit 2b95e97
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions app/views/root/_transaction_cross_domain_analytics.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
<script id="transaction_cross_domain_analytics">
if (typeof window.ga === "function") {
ga('create', '<%= ga_account_code %>', 'auto', {'name': 'transactionTracker'});

// Load the plugin.
ga('require', 'linker');
ga('transactionTracker.require', 'linker');

// Define which domains to autoLink.
ga('linker:autoLink', ['service.gov.uk']);
ga('transactionTracker.linker:autoLink', ['service.gov.uk']);

ga('transactionTracker.set', 'anonymizeIp', true);
ga('transactionTracker.send', 'pageview');
if (typeof GOVUK.analytics != "undefined") {
GOVUK.analytics.addLinkedTrackerDomain('<%= ga_account_code %>', 'transactionTracker', 'service.gov.uk');
}
</script>

0 comments on commit 2b95e97

Please sign in to comment.