From 82917e27fd83b0032f6befc66cd1fcfd3ecdf3b8 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Mon, 11 Dec 2023 15:41:28 +0000 Subject: [PATCH 1/2] Add scroll tracking to guides - adds percentage scroll tracking to a selection of guide pages --- app/views/content_items/guide.html.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/views/content_items/guide.html.erb b/app/views/content_items/guide.html.erb index 97bfa6149..315d48e39 100644 --- a/app/views/content_items/guide.html.erb +++ b/app/views/content_items/guide.html.erb @@ -131,6 +131,14 @@ "/repaying-your-student-loan/which-repayment-plan-you-are-on", "/changing-passport-information", "/change-circumstances-visa-brp", + "/standard-visitor", + "/apply-to-come-to-the-uk", + "/change-address-v5c", + "/pip", + "/skilled-worker-visa", + "/child-benefit", + "/vehicle-tax-rate-tables", + "/tax-codes" ] full_url = [@content_item.base_path, @content_item.part_slug].compact.join('/') From 6baaec1f3959a8b0d7f548f3e4ee9dde543e6a0f Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Mon, 11 Dec 2023 15:49:54 +0000 Subject: [PATCH 2/2] Add scroll tracking to answers - adds percentage scroll tracking to a selection of answer pages --- app/views/content_items/answer.html.erb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/views/content_items/answer.html.erb b/app/views/content_items/answer.html.erb index 006de7f60..4522c6ed6 100644 --- a/app/views/content_items/answer.html.erb +++ b/app/views/content_items/answer.html.erb @@ -10,6 +10,21 @@ scroll_track_percent_paths = [ "/get-coronavirus-test", ] + ga4_scroll_track_headings_paths = [ + "/personal-tax-account", + "/log-in-file-self-assessment-tax-return", + "/benefits-calculators", + "/national-minimum-wage-rates", + "/order-coronavirus-rapid-lateral-flow-tests", + "/contact-hmrc", + "/dbs-update-service", + "/tax-free-childcare", + "/check-income-tax-current-year", + "/apply-apprenticeship", + "/report-covid19-result", + "/order-copy-birth-death-marriage-certificate", + "/global-health-insurance-card" + ] %> <% if scroll_track_headings_paths.include?(@content_item.base_path) %> @@ -17,6 +32,10 @@ <% end %> + <% if ga4_scroll_track_headings_paths.include?(@content_item.base_path) %> + + <% end %> + <%= @requested_variant.analytics_meta_tag.html_safe if @requested_variant.present? %> <% end %>