Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Commit

Permalink
Merge pull request #182 from alphagov/remove-classic-analytics
Browse files Browse the repository at this point in the history
Fully remove Google Analytics classic
  • Loading branch information
bradwright committed May 28, 2015
2 parents b0e65d6 + 32f592a commit db0d0d7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ gem "logstasher", "~> 0.6"
gem "airbrake", "~> 4.1"

gem "coffee-rails", "~> 4.1"
gem "govuk_frontend_toolkit", "~> 3.5.1"
gem "govuk_frontend_toolkit", "~> 4.0.0"
gem "jquery-rails", "~> 2.1.3"
gem "sass-rails", "~> 5.0"
gem "therubyracer", "~> 0.12.0"
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ GEM
kramdown (~> 1.4.1)
nokogiri (~> 1.5)
sanitize (~> 2.1.0)
govuk_frontend_toolkit (3.5.1)
govuk_frontend_toolkit (4.0.0)
rails (>= 3.1.0)
sass (>= 3.2.0)
govuk_template (0.12.0)
Expand Down Expand Up @@ -294,7 +294,7 @@ DEPENDENCIES
forgery
gds-api-adapters (~> 18.3)
govspeak (~> 3.3)
govuk_frontend_toolkit (~> 3.5.1)
govuk_frontend_toolkit (~> 4.0.0)
govuk_template (= 0.12.0)
hashie
httparty
Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/analytics-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"use strict";

// Load Google Analytics libraries
GOVUK.Tracker.load();
GOVUK.Analytics.load();

// Use document.domain in dev, preview and staging so that tracking works
// Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain;

// Configure profiles and make interface public
// for custom dimensions, virtual pageviews and events
GOVUK.analytics = new GOVUK.Tracker({
GOVUK.analytics = new GOVUK.Analytics({
universalId: 'UA-26179049-1',
cookieDomain: cookieDomain
});
Expand All @@ -19,12 +19,12 @@

// Set custom dimensions before tracking pageviews
if ($section) {
GOVUK.analytics.setDimension(1, $section.attr('content'), 'Section');
GOVUK.analytics.setDimension(1, $section.attr('content'));
}

GOVUK.analytics.setDimension(2, 'custom-tool', 'Format');
GOVUK.analytics.setDimension(2, 'custom-tool'); // Format
if (window.devicePixelRatio) {
GOVUK.analytics.setDimension(11, window.devicePixelRatio, 'Pixel Ratio', 2);
GOVUK.analytics.setDimension(11, window.devicePixelRatio);
}

// Activate any event plugins eg. print intent, error tracking
Expand Down
3 changes: 1 addition & 2 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
//= require jquery.datepicker
//= require jquery.history
//= require govuk/analytics/google-analytics-universal-tracker
//= require govuk/analytics/google-analytics-classic-tracker
//= require govuk/analytics/tracker
//= require govuk/analytics/analytics
//= require govuk/analytics/print-intent
//= require govuk/analytics/error-tracking
//= require popup
Expand Down

0 comments on commit db0d0d7

Please sign in to comment.