From f7d6a41612da7b914d3bfc6c966cbe88d98ecf19 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Thu, 30 Nov 2023 11:55:54 +0000 Subject: [PATCH] Add GA4 scroll tracking to guide pages - adds GA4 scroll tracking to 110 specific guide pages --- app/views/content_items/guide.html.erb | 116 +++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/app/views/content_items/guide.html.erb b/app/views/content_items/guide.html.erb index 2c5a4f64c..97bfa6149 100644 --- a/app/views/content_items/guide.html.erb +++ b/app/views/content_items/guide.html.erb @@ -21,6 +21,118 @@ "/apply-to-come-to-the-uk", ] + ga4_scroll_track_headings_paths = [ + "/log-in-register-hmrc-online-services", + "/universal-credit", + "/pay-dartford-crossing-charge", + "/prove-right-to-work/get-a-share-code-online", + "/prove-right-to-work", + "/renew-adult-passport/renew", + "/change-address-driving-licence", + "/self-assessment-tax-returns", + "/vehicle-log-book", + "/income-tax-rates", + "/the-warm-home-discount-scheme", + "/winter-fuel-payment", + "/pay-self-assessment-tax-bill", + "/log-in-register-hmrc-online-services/register", + "/pip/how-much-youll-get", + "/help-with-childcare-costs", + "/pip/eligibility", + "/pension-credit", + "/child-maintenance-service", + "/child-benefit/how-to-claim", + "/carers-allowance", + "/photos-for-passports", + "/budgeting-help-benefits/how-to-apply", + "/update-uk-visas-immigration-account-details", + "/renew-adult-passport", + "/new-state-pension/what-youll-get", + "/get-a-passport-urgently", + "/power-of-attorney", + "/child-trust-funds/find-a-child-trust-fund", + "/student-finance", + "/apply-national-insurance-number/how-to-apply", + "/inheritance-tax", + "/child-benefit-tax-charge", + "/power-of-attorney/make-lasting-power", + "/prove-right-to-rent", + "/attendance-allowance/how-to-claim", + "/prove-right-to-rent/get-a-share-code-online", + "/new-state-pension", + "/self-assessment-tax-returns/sending-return", + "/limited-company-formation/register-your-company", + "/electoral-register", + "/biometric-residence-permits", + "/winter-fuel-payment/how-to-claim", + "/self-assessment-tax-returns/who-must-send-a-tax-return", + "/apply-national-insurance-number", + "/get-a-passport-urgently/1-week-fast-track-service", + "/life-in-the-uk-test", + "/jobseekers-allowance", + "/the-warm-home-discount-scheme/low-income-England-Wales", + "/cold-weather-payment", + "/pay-corporation-tax", + "/repaying-your-student-loan", + "/carers-allowance/how-to-claim", + "/attendance-allowance/eligibility", + "/national-insurance", + "/applying-for-probate", + "/contact-pension-service", + "/employment-support-allowance/eligibility", + "/holiday-entitlement-rights", + "/get-a-child-passport", + "/paye-online", + "/national-insurance/your-national-insurance-number", + "/get-a-passport-urgently/online-premium-service", + "/log-in-register-hmrc-online-services/problems-signing-in", + "/pay-vat", + "/jobseekers-allowance/eligibility", + "/tax-overpayments-and-underpayments/if-youre-due-a-refund", + "/help-with-childcare-costs/free-childcare-2-year-olds", + "/applying-for-probate/apply-for-probate", + "/pension-credit/how-to-claim", + "/report-changes-child-benefit", + "/tax-codes/how-to-update-your-tax-code", + "/get-help-savings-low-income", + "/disability-living-allowance-children", + "/jobseekers-allowance/apply-new-style-jsa", + "/change-name-deed-poll", + "/statutory-sick-pay/what-youll-get", + "/get-information-about-property-and-land/copies-of-deeds", + "/schools-admissions/how-to-apply", + "/financial-help-disabled", + "/redundancy-your-rights/redundancy-pay", + "/tax-overpayments-and-underpayments", + "/tax-codes/emergency-tax-codes", + "/access-to-work", + "/skilled-worker-visa/apply-from-outside-the-uk", + "/disability-living-allowance-children/how-to-claim", + "/statutory-sick-pay/eligibility", + "/health-conditions-and-driving", + "/tax-relief-for-employees/working-at-home", + "/vehicle-log-book/if-you-cannot-apply-online", + "/what-different-qualification-levels-mean/list-of-qualification-levels", + "/tb-test-visa", + "/apply-to-come-to-the-uk/prepare-your-application", + "/apply-citizenship-indefinite-leave-to-remain/how-to-apply", + "/child-car-seats-the-rules", + "/pip/change-of-circumstances", + "/child-benefit-tax-charge/pay-the-charge", + "/uk-visa-sponsorship-employers", + "/personalised-vehicle-registration-numbers", + "/renew-adult-passport/replace", + "/apply-boiler-upgrade-scheme/check-if-youre-eligible", + "/council-housing", + "/carers-allowance/effect-on-other-benefits", + "/income-tax", + "/voluntary-national-insurance-contributions", + "/inheritance-tax/passing-on-home", + "/repaying-your-student-loan/which-repayment-plan-you-are-on", + "/changing-passport-information", + "/change-circumstances-visa-brp", + ] + full_url = [@content_item.base_path, @content_item.part_slug].compact.join('/') %> <% if scroll_track_headings_paths.include?(full_url) %> @@ -28,6 +140,10 @@ <% elsif scroll_track_percent_paths.include?(@content_item.base_path) %> <% end %> + + <% if ga4_scroll_track_headings_paths.include?(full_url) %> + + <% end %> <% end %> <% unless @content_item.requesting_a_part? %>