From 1c73f4304a71c5f4f2ea50520f4b021a2051a417 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Tue, 3 Sep 2024 10:54:50 +0100 Subject: [PATCH] Add section parameter to browse link tracking - adds a 'section' parameter to the GA4 tracking for action links to match the heading of the section they are in --- app/helpers/browse_helper.rb | 1 + spec/helpers/browse_helper_spec.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/helpers/browse_helper.rb b/app/helpers/browse_helper.rb index 3b750515e..6911245e6 100644 --- a/app/helpers/browse_helper.rb +++ b/app/helpers/browse_helper.rb @@ -41,6 +41,7 @@ def popular_links_for_slug(slug) index_link: index, index_total: count, text: link[:title], + section: "popular tasks", }, }, } diff --git a/spec/helpers/browse_helper_spec.rb b/spec/helpers/browse_helper_spec.rb index 6faab2d14..af7426cb5 100644 --- a/spec/helpers/browse_helper_spec.rb +++ b/spec/helpers/browse_helper_spec.rb @@ -36,6 +36,7 @@ def popular_tasks_variant_b_page? index_link: 1, index_total: 3, text: "HMRC online services: sign in or set up an account", + section: "popular tasks", }, }, }, @@ -51,6 +52,7 @@ def popular_tasks_variant_b_page? index_link: 2, index_total: 3, text: "Self Assessment tax returns", + section: "popular tasks", }, }, }, @@ -66,6 +68,7 @@ def popular_tasks_variant_b_page? index_link: 3, index_total: 3, text: "Pay employers' PAYE", + section: "popular tasks", }, }, },