Skip to content
This repository has been archived by the owner on Feb 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #558 from alphagov/remove-classic-analytics
Browse files Browse the repository at this point in the history
Remove Google Analytics classic
  • Loading branch information
bradwright committed Jun 1, 2015
2 parents d31bfd9 + 7d3a9f1 commit cd072b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions _includes/layouts/_body.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script src="/service-manual/assets/javascript/jquery-1.7.2.js"></script>
<script src="/service-manual/assets/javascript/jquery-ui-1.10.2.custom.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/toolkit/javascripts/vendor/jquery/jquery.player.min.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/toolkit/javascripts/govuk/analytics/google-analytics-classic-tracker.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/toolkit/javascripts/govuk/analytics/google-analytics-universal-tracker.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/toolkit/javascripts/govuk/analytics/tracker.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/toolkit/javascripts/govuk/analytics/analytics.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/javascript/analytics-init.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/javascript/toggler.js?cache={{ site.time | date: "%s" }}"></script>
<script src="/service-manual/assets/javascript/media-player-loader.js?cache={{ site.time | date: "%s" }}"></script>
Expand Down
9 changes: 4 additions & 5 deletions service-manual/assets/javascript/analytics-init.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
(function() {
"use strict";

GOVUK.Tracker.load();
GOVUK.Analytics.load();
var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain;

GOVUK.analytics = new GOVUK.Tracker({
universalId: 'UA-26179049-7',
classicId: 'UA-26179049-1',
GOVUK.analytics = new GOVUK.Analytics({
universalId: 'UA-26179049-1',
cookieDomain: cookieDomain
});

if (window.devicePixelRatio) {
GOVUK.analytics.setDimension(11, window.devicePixelRatio, 'Pixel Ratio', 2);
GOVUK.analytics.setDimension(11, window.devicePixelRatio);
}

GOVUK.analytics.trackPageview();
Expand Down

0 comments on commit cd072b2

Please sign in to comment.