From 3a7aec69cc861419e6c4761f0908ff37cf8e6e96 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 9 Dec 2024 16:57:39 +0000 Subject: [PATCH] Fix GA4 event data on taxon pages Set `disable_ga4` to true for the document-list component used to render each section of the taxon page. This fixes an issue on taxon pages (/education for example), where link clicks would fire 2 events instead of 1, both of which were missing some event data. --- app/views/taxons/sections/_guidance_and_regulation.html.erb | 1 + app/views/taxons/sections/_news_and_communications.html.erb | 1 + app/views/taxons/sections/_policy_and_engagement.html.erb | 1 + app/views/taxons/sections/_research_and_statistics.html.erb | 1 + app/views/taxons/sections/_services.html.erb | 1 + app/views/taxons/sections/_transparency.html.erb | 1 + 6 files changed, 6 insertions(+) diff --git a/app/views/taxons/sections/_guidance_and_regulation.html.erb b/app/views/taxons/sections/_guidance_and_regulation.html.erb index 36d2fcaa1..9301320aa 100644 --- a/app/views/taxons/sections/_guidance_and_regulation.html.erb +++ b/app/views/taxons/sections/_guidance_and_regulation.html.erb @@ -1,4 +1,5 @@ <%= render 'govuk_publishing_components/components/document_list', + disable_ga4: true, items: section[:documents], margin_bottom: 7 %> diff --git a/app/views/taxons/sections/_news_and_communications.html.erb b/app/views/taxons/sections/_news_and_communications.html.erb index 5d3721d0f..e8c3a3eff 100644 --- a/app/views/taxons/sections/_news_and_communications.html.erb +++ b/app/views/taxons/sections/_news_and_communications.html.erb @@ -19,6 +19,7 @@ <% if section[:documents].any? %> <%= render 'govuk_publishing_components/components/document_list', + disable_ga4: true, items: section[:documents_with_promoted], margin_bottom: 7 %> diff --git a/app/views/taxons/sections/_policy_and_engagement.html.erb b/app/views/taxons/sections/_policy_and_engagement.html.erb index 36d2fcaa1..9301320aa 100644 --- a/app/views/taxons/sections/_policy_and_engagement.html.erb +++ b/app/views/taxons/sections/_policy_and_engagement.html.erb @@ -1,4 +1,5 @@ <%= render 'govuk_publishing_components/components/document_list', + disable_ga4: true, items: section[:documents], margin_bottom: 7 %> diff --git a/app/views/taxons/sections/_research_and_statistics.html.erb b/app/views/taxons/sections/_research_and_statistics.html.erb index 36d2fcaa1..9301320aa 100644 --- a/app/views/taxons/sections/_research_and_statistics.html.erb +++ b/app/views/taxons/sections/_research_and_statistics.html.erb @@ -1,4 +1,5 @@ <%= render 'govuk_publishing_components/components/document_list', + disable_ga4: true, items: section[:documents], margin_bottom: 7 %> diff --git a/app/views/taxons/sections/_services.html.erb b/app/views/taxons/sections/_services.html.erb index 36d2fcaa1..9301320aa 100644 --- a/app/views/taxons/sections/_services.html.erb +++ b/app/views/taxons/sections/_services.html.erb @@ -1,4 +1,5 @@ <%= render 'govuk_publishing_components/components/document_list', + disable_ga4: true, items: section[:documents], margin_bottom: 7 %> diff --git a/app/views/taxons/sections/_transparency.html.erb b/app/views/taxons/sections/_transparency.html.erb index 36d2fcaa1..9301320aa 100644 --- a/app/views/taxons/sections/_transparency.html.erb +++ b/app/views/taxons/sections/_transparency.html.erb @@ -1,4 +1,5 @@ <%= render 'govuk_publishing_components/components/document_list', + disable_ga4: true, items: section[:documents], margin_bottom: 7 %>