From 97681c9c1ac705ba9cb460f77417fbb97409d8dc Mon Sep 17 00:00:00 2001 From: Dafydd Vaughan Date: Thu, 26 May 2016 16:11:11 +0100 Subject: [PATCH] Track when HMRC webchat is offered to users in GA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently track when users interact with HMRC’s webchat service (eg when they click the ‘accept’ or ‘reject’ buttons). This commit adds in an event to track when the webchat service is offered to users. This event, alongside other data such as page views, will give us an idea of: 1) how many people are being presented with webchat but aren’t doing anything with it 2) how many people are not being presented with webchat at all --- app/assets/javascripts/webchat.js.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/webchat.js.erb b/app/assets/javascripts/webchat.js.erb index 3df3a07a5..132f07c9d 100644 --- a/app/assets/javascripts/webchat.js.erb +++ b/app/assets/javascripts/webchat.js.erb @@ -51,6 +51,7 @@ if (message.evt === 'opened') { webchat.$banner.addClass('open'); webchat.$banner.attr('aria-hidden', false); + GOVUK.analytics.trackEvent('webchat', 'offered'); } else if (message.evt === 'closed') { webchat.$banner.removeClass('open'); webchat.$banner.attr('aria-hidden', true);