From 7c313f4faabcc0fafcb98edce068b0db730806e8 Mon Sep 17 00:00:00 2001 From: Jake Benilov Date: Thu, 26 Feb 2015 16:00:27 +0000 Subject: [PATCH] Send analytics event through the GOV.UK Analytics API. https://www.pivotaltracker.com/n/projects/1261204/stories/88175032 This change wraps the GA event in the [newly introduced](https://github.com/alphagov/static/pull/549) analytics API. This will aid in the migration from GA Classic to Universal Analytics, while remaining functionally equivalent during the migration. --- app/assets/javascripts/application/filter-list-items.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/application/filter-list-items.js b/app/assets/javascripts/application/filter-list-items.js index 3ab220439af..5ede64937af 100644 --- a/app/assets/javascripts/application/filter-list-items.js +++ b/app/assets/javascripts/application/filter-list-items.js @@ -40,7 +40,7 @@ filter._trackTimeout = root.setTimeout(function(){ var pagePath = window.location.pathname.split('/').pop(); if(pagePath){ - window._gaq && _gaq.push(['_trackEvent', 'searchBoxFilter', search, pagePath, 0, true]); + GOVUK.analytics.trackEvent('searchBoxFilter', search, {label: pagePath, nonInteraction: true}); } }, 1000); },