From e574d0d89a430b023506150e5055dc362e7f9bee Mon Sep 17 00:00:00 2001
From: AshGDS <8880610+AshGDS@users.noreply.github.com>
Date: Mon, 4 Sep 2023 14:36:42 +0100
Subject: [PATCH 1/2] Enable GA4 tracking on the phase banner
---
app/helpers/service_manual_phase_label_helper.rb | 1 +
app/views/layouts/application.html.erb | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/helpers/service_manual_phase_label_helper.rb b/app/helpers/service_manual_phase_label_helper.rb
index 69e70ae23..6e3d65d71 100644
--- a/app/helpers/service_manual_phase_label_helper.rb
+++ b/app/helpers/service_manual_phase_label_helper.rb
@@ -3,6 +3,7 @@ def render_phase_label(presented_object, message)
if presented_object.respond_to?(:phase) && %w[alpha beta].include?(presented_object.phase)
render "govuk_publishing_components/components/phase_banner",
phase: presented_object.phase,
+ ga4_tracking: true,
message:
end
end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index e03fb22bf..8c3eee441 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -11,7 +11,7 @@
<% if @content_item.show_phase_banner? %>
- <%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase %>
+ <%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase, ga4_tracking: true %>
<% end %>
<% if @content_item.service_manual? %>
<%= render_phase_label @content_item, content_for(:phase_message) %>
From bbec047711e5ba6fa4ea87a5c9b15ee92bfdd15d Mon Sep 17 00:00:00 2001
From: AshGDS <8880610+AshGDS@users.noreply.github.com>
Date: Tue, 5 Sep 2023 10:32:28 +0100
Subject: [PATCH 2/2] Enable GA4 tracking on the devolved nations banner
---
app/views/content_items/call_for_evidence.html.erb | 3 ++-
app/views/content_items/consultation.html.erb | 3 ++-
app/views/content_items/detailed_guide.html.erb | 3 ++-
app/views/content_items/html_publication.html.erb | 3 ++-
app/views/content_items/publication.html.erb | 3 ++-
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/app/views/content_items/call_for_evidence.html.erb b/app/views/content_items/call_for_evidence.html.erb
index 944b6caee..a93436dce 100644
--- a/app/views/content_items/call_for_evidence.html.erb
+++ b/app/views/content_items/call_for_evidence.html.erb
@@ -24,7 +24,8 @@
<% if @content_item.national_applicability.present? %>
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
- type: @content_item.schema_name
+ type: @content_item.schema_name,
+ ga4_tracking: true,
} %>
<% end %>
diff --git a/app/views/content_items/consultation.html.erb b/app/views/content_items/consultation.html.erb
index 5ee1eaa01..6674dca97 100644
--- a/app/views/content_items/consultation.html.erb
+++ b/app/views/content_items/consultation.html.erb
@@ -25,7 +25,8 @@
<% if @content_item.national_applicability.present? %>
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
- type: @content_item.schema_name
+ type: @content_item.schema_name,
+ ga4_tracking: true,
} %>
<% end %>
diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb
index bb2ecaba9..8aa2ae576 100644
--- a/app/views/content_items/detailed_guide.html.erb
+++ b/app/views/content_items/detailed_guide.html.erb
@@ -78,7 +78,8 @@
<% if @content_item.national_applicability.present? %>
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
- type: @content_item.schema_name
+ type: @content_item.schema_name,
+ ga4_tracking: true,
} %>
<% end %>
diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb
index bff600241..f397791e4 100644
--- a/app/views/content_items/html_publication.html.erb
+++ b/app/views/content_items/html_publication.html.erb
@@ -50,7 +50,8 @@
<% if @content_item.national_applicability.present? %>
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
- type: @content_item.schema_name
+ type: @content_item.schema_name,
+ ga4_tracking: true,
} %>
<% end %>
diff --git a/app/views/content_items/publication.html.erb b/app/views/content_items/publication.html.erb
index 77184b7a9..65ec3d298 100644
--- a/app/views/content_items/publication.html.erb
+++ b/app/views/content_items/publication.html.erb
@@ -44,7 +44,8 @@
<% if @content_item.national_applicability.present? %>
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
- type: @content_item.schema_name
+ type: @content_item.schema_name,
+ ga4_tracking: true,
} %>
<% end %>