diff --git a/Gemfile b/Gemfile index 5858ad308..0b2f953e3 100644 --- a/Gemfile +++ b/Gemfile @@ -31,8 +31,7 @@ group :development, :test do end gem 'plek', '1.11.0' - -gem 'govuk_frontend_toolkit', '~> 4.1.1' +gem 'govuk_frontend_toolkit', '~> 4.2.0' if ENV['GOVUK_TEMPLATE_DEV'] gem 'govuk_template', :path => "../govuk_template" diff --git a/Gemfile.lock b/Gemfile.lock index 4859a6152..8ccf0ca54 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,7 +58,7 @@ GEM plek rack-cache rest-client (~> 1.8.0) - govuk_frontend_toolkit (4.1.1) + govuk_frontend_toolkit (4.2.0) rails (>= 3.1.0) sass (>= 3.2.0) govuk_template (0.13.0) @@ -186,7 +186,7 @@ DEPENDENCIES capybara (= 2.1.0) exception_notification gds-api-adapters (= 20.1.1) - govuk_frontend_toolkit (~> 4.1.1) + govuk_frontend_toolkit (~> 4.2.0) govuk_template (= 0.13.0) image_optim (= 0.17.1) jasmine-rails (~> 0.10.6) diff --git a/app/assets/javascripts/analytics.js b/app/assets/javascripts/analytics.js index 0b5b16057..d50ea5ce2 100644 --- a/app/assets/javascripts/analytics.js +++ b/app/assets/javascripts/analytics.js @@ -2,6 +2,8 @@ //= require govuk/analytics/analytics //= require govuk/analytics/print-intent //= require govuk/analytics/error-tracking +//= require govuk/analytics/external-link-tracker +//= require govuk/analytics/download-link-tracker //= require analytics/static-analytics //= require analytics/init diff --git a/app/assets/javascripts/analytics/static-analytics.js b/app/assets/javascripts/analytics/static-analytics.js index 0e799c5a9..9275d37e0 100644 --- a/app/assets/javascripts/analytics/static-analytics.js +++ b/app/assets/javascripts/analytics/static-analytics.js @@ -21,6 +21,10 @@ // Begin error and print tracking GOVUK.analyticsPlugins.error(); GOVUK.analyticsPlugins.printIntent(); + GOVUK.analyticsPlugins.externalLinkTracker(); + GOVUK.analyticsPlugins.downloadLinkTracker({ + selector: 'a[href*="/government/uploads"], a[href*="assets.digital.cabinet-office.gov.uk"]' + }); function setPixelDensityDimension() { if (window.devicePixelRatio) { @@ -91,8 +95,8 @@ this.setRenderingApplicationDimension(dimensions['rendering-application']); }; - StaticAnalytics.prototype.trackPageview = function(path, title) { - this.analytics.trackPageview(path, title); + StaticAnalytics.prototype.trackPageview = function(path, title, options) { + this.analytics.trackPageview(path, title, options); }; StaticAnalytics.prototype.trackEvent = function(category, action, options) {