Skip to content

Commit 6500698

Browse files
committed
Remove ga4_tracking: true component options
- all components that previously accepted this option now have GA4 tracking enabled by default, so these options are no longer needed - no tracking should change as a result of this change
1 parent 6d70c74 commit 6500698

28 files changed

+19
-55
lines changed

app/helpers/service_manual_phase_label_helper.rb

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ def render_phase_label(presented_object, message)
33
if presented_object.respond_to?(:phase) && %w[alpha beta].include?(presented_object.phase)
44
render "govuk_publishing_components/components/phase_banner",
55
phase: presented_object.phase,
6-
ga4_tracking: true,
76
message:
87
end
98
end

app/views/components/_contents_list_with_body.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div id="contents" class="app-c-contents-list-with-body"<%= sticky_attr %>>
99
<% if contents.any? %>
1010
<div class="responsive-bottom-margin">
11-
<%= render 'govuk_publishing_components/components/contents_list', contents: contents, ga4_tracking: true %>
11+
<%= render 'govuk_publishing_components/components/contents_list', contents: contents %>
1212
</div>
1313
<% end %>
1414
<%= block %>

app/views/content_items/call_for_evidence.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<%= render "govuk_publishing_components/components/devolved_nations", {
2626
national_applicability: @content_item.national_applicability,
2727
type: @content_item.schema_name,
28-
ga4_tracking: true,
2928
} %>
3029
<% end %>
3130

app/views/content_items/consultation.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<%= render "govuk_publishing_components/components/devolved_nations", {
2727
national_applicability: @content_item.national_applicability,
2828
type: @content_item.schema_name,
29-
ga4_tracking: true,
3029
} %>
3130
<% end %>
3231

app/views/content_items/detailed_guide.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
<%= render "govuk_publishing_components/components/devolved_nations", {
8080
national_applicability: @content_item.national_applicability,
8181
type: @content_item.schema_name,
82-
ga4_tracking: true,
8382
} %>
8483
<% end %>
8584

app/views/content_items/field_of_operation.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<div class="govuk-grid-column-one-third">
1616
<%= render "govuk_publishing_components/components/contents_list", {
1717
contents: @content_item.contents,
18-
ga4_tracking: true
1918
} %>
2019
</div>
2120
<% end %>

app/views/content_items/guide.html.erb

+2-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
href: "#guide-contents"
4949
} %>
5050
<aside class="part-navigation-container" role="complementary">
51-
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("guide.pages_in_guide") }, contents: @content_item.part_link_elements, underline_links: true, ga4_tracking: true %>
51+
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("guide.pages_in_guide") }, contents: @content_item.part_link_elements, underline_links: true %>
5252
</aside>
5353
<% end %>
5454
</div>
@@ -73,11 +73,7 @@
7373
<% end %>
7474

7575
<% if @content_item.show_guide_navigation? %>
76-
<%
77-
previous_and_next_with_ga4_tracking = { ga4_tracking: true }
78-
previous_and_next_with_ga4_tracking.merge!(@content_item.previous_and_next_navigation) # @content_item is frozen so we make a new hash
79-
%>
80-
<%= render 'govuk_publishing_components/components/previous_and_next_navigation', previous_and_next_with_ga4_tracking %>
76+
<%= render 'govuk_publishing_components/components/previous_and_next_navigation', @content_item.previous_and_next_navigation %>
8177

8278
<div class="responsive-bottom-margin">
8379
<a href="<%= @content_item.print_link %>"

app/views/content_items/guide_single.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<% if @content_item.show_guide_navigation? %>
2323
<aside class="part-navigation-container" role="complementary">
24-
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("guide.pages_in_guide") }, contents: @content_item.part_link_elements, underline_links: true, ga4_tracking: true %>
24+
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("guide.pages_in_guide") }, contents: @content_item.part_link_elements, underline_links: true %>
2525
</aside>
2626
<% end %>
2727
</div>

app/views/content_items/hmrc_manual_section.html.erb

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
heading_level: 1,
66
margin_bottom: 6,
77
green_background: true,
8-
type: I18n.t("manuals.hmrc_manual_type"),
8+
type: I18n.t("manuals.hmrc_manual_type"),
99
} %>
1010
<% end %>
1111

@@ -25,10 +25,6 @@
2525
<% end %>
2626

2727
<div class="govuk-grid-column-full">
28-
<%
29-
previous_and_next_with_ga4_tracking = { ga4_tracking: true }
30-
previous_and_next_with_ga4_tracking.merge!(@content_item.previous_and_next_links) # @content_item is frozen so we make a new hash
31-
%>
32-
<%= render "govuk_publishing_components/components/previous_and_next_navigation", previous_and_next_with_ga4_tracking %>
28+
<%= render "govuk_publishing_components/components/previous_and_next_navigation", @content_item.previous_and_next_links %>
3329
</div>
3430
<% end %>

app/views/content_items/how_government_works.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
text: "History of government",
6363
}
6464
],
65-
ga4_tracking: true
6665
} %>
6766
</div>
6867

app/views/content_items/html_publication.html.erb

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@
5252
<%= render "govuk_publishing_components/components/devolved_nations", {
5353
national_applicability: @content_item.national_applicability,
5454
type: @content_item.schema_name,
55-
ga4_tracking: true,
5655
} %>
5756
<% end %>
5857

5958
<div id="contents">
6059
<div class="govuk-grid-row">
6160
<% if @content_item.contents.any? %>
6261
<div class="govuk-grid-column-one-quarter-from-desktop contents-list-container">
63-
<%= render 'govuk_publishing_components/components/contents_list', contents: @content_item.contents, format_numbers: true, ga4_tracking: true %>
62+
<%= render 'govuk_publishing_components/components/contents_list', contents: @content_item.contents, format_numbers: true %>
6463

6564
<%= render 'govuk_publishing_components/components/print_link', {
6665
margin_top: 0,

app/views/content_items/manual_section.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
%>
5757

5858
<%= render "govuk_publishing_components/components/accordion", {
59-
ga4_tracking: true,
6059
anchor_navigation: true,
6160
items: items,
6261
} %>

app/views/content_items/manuals/_header.html.erb

+1-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@
2121
margin_bottom: margin_bottom,
2222
} %>
2323

24-
<%
25-
# The metadata component on this page receives ga4_tracking: true as it has a 'See all updates' link.
26-
metadata_with_ga4_tracking = { ga4_tracking: true }
27-
metadata_with_ga4_tracking.merge!(content_item.manual_metadata) # @content_item is frozen so we make a new hash
28-
%>
29-
<%= render 'govuk_publishing_components/components/metadata', metadata_with_ga4_tracking %>
24+
<%= render 'govuk_publishing_components/components/metadata', content_item.manual_metadata %>
3025

3126
<div class="in-manual-search">
3227
<%

app/views/content_items/manuals/_manual_section_layout.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div id="manuals-frontend" class="manuals-frontend-body">
55
<% if show_contents %>
66
<%= render "govuk_publishing_components/components/contents_list", {
7-
aria: { label: t("manuals.pages_in_manual_section") }, contents: @content_item.contents, underline_links: true, ga4_tracking: true
7+
aria: { label: t("manuals.pages_in_manual_section") }, contents: @content_item.contents, underline_links: true
88
} %>
99
<% end %>
1010

app/views/content_items/manuals/_updates.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
<%= render "govuk_publishing_components/components/accordion", {
2222
heading_level: 3,
23-
ga4_tracking: true,
2423
items: updates_by_year.each.with_index(1).map do |updated_documents, index|
2524
accordion_content = capture do %>
2625
<% change_notes = updated_documents.last %>

app/views/content_items/publication.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
<%= render "govuk_publishing_components/components/devolved_nations", {
4646
national_applicability: @content_item.national_applicability,
4747
type: @content_item.schema_name,
48-
ga4_tracking: true,
4948
} %>
5049
<% end %>
5150

app/views/content_items/service_manual_topic.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<% if @content_item.display_as_accordion? %>
2929
<% items = @content_item.accordion_content %>
3030
<%= render "govuk_publishing_components/components/accordion", {
31-
ga4_tracking: true,
3231
items: items,
3332
} %>
3433
<% else %>

app/views/content_items/statistics_announcement.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
<% end %>
4545
</div>
4646
<div class="govuk-grid-column-one-third">
47-
<%= render 'govuk_publishing_components/components/related_navigation', content_item: @content_item.content_item.parsed_content, context: :sidebar, ga4_tracking: true %>
47+
<%= render 'govuk_publishing_components/components/related_navigation', content_item: @content_item.content_item.parsed_content, context: :sidebar %>
4848
</div>
4949
</div>

app/views/content_items/travel_advice.html.erb

+2-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<% end %>
2727

2828
<aside class="part-navigation-container" role="complementary">
29-
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("travel_advice.pages") }, contents: @content_item.part_link_elements, underline_links: true, ga4_tracking: true %>
29+
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("travel_advice.pages") }, contents: @content_item.part_link_elements, underline_links: true %>
3030

3131
<div
3232
data-module="ga4-link-tracker"
@@ -63,11 +63,7 @@
6363
<% end %>
6464
</div>
6565

66-
<%
67-
previous_and_next_with_ga4_tracking = { ga4_tracking: true }
68-
previous_and_next_with_ga4_tracking.merge!(@content_item.previous_and_next_navigation) # @content_item is frozen so we make a new hash
69-
%>
70-
<%= render 'govuk_publishing_components/components/previous_and_next_navigation', previous_and_next_with_ga4_tracking %>
66+
<%= render 'govuk_publishing_components/components/previous_and_next_navigation', @content_item.previous_and_next_navigation %>
7167

7268
<div class="responsive-bottom-margin">
7369
<a href="<%= @content_item.print_link %>"

app/views/content_items/worldwide_office.html.erb

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
<article class="govuk-grid-row">
66
<div class="govuk-grid-column-one-third">
77
<%= render "govuk_publishing_components/components/contents_list",
8-
contents: @content_item.contents,
9-
underline_links: true,
10-
ga4_tracking: true
8+
contents: @content_item.contents,
9+
underline_links: true
1110
%>
1211
</div>
1312

app/views/histories/10_downing_street.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
text: "Larry, Chief Mouser to the Cabinet&nbsp;Office".html_safe,
7171
},
7272
],
73-
ga4_tracking: true
7473
} %>
7574
</nav>
7675

app/views/histories/11_downing_street.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
text: "Sir John Soane",
6363
},
6464
],
65-
ga4_tracking: true
6665
} %>
6766
</nav>
6867

app/views/histories/1_horse_guards_road.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
text: "The Cabinet War Rooms",
4242
},
4343
],
44-
ga4_tracking: true
4544
} %>
4645
</nav>
4746
<div class="govuk-grid-column-two-thirds">

app/views/histories/king_charles_street.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
text: "Fine Rooms",
3535
},
3636
],
37-
ga4_tracking: true
3837
} %>
3938
</nav>
4039

app/views/histories/lancaster_house.html.erb

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
text: "Contact details",
7575
},
7676
],
77-
ga4_tracking: true
7877
} %>
7978
</nav>
8079

app/views/layouts/application.html.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="govuk-grid-row">
1212
<div class="govuk-grid-column-full">
1313
<% if @content_item.show_phase_banner? %>
14-
<%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase, ga4_tracking: true %>
14+
<%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase %>
1515
<% end %>
1616
<% if @content_item.service_manual? %>
1717
<%= render_phase_label @content_item, content_for(:phase_message) %>
@@ -25,7 +25,7 @@
2525
<% if @content_item.try(:back_link) %>
2626
<%= render 'govuk_publishing_components/components/back_link', href: @content_item.back_link %>
2727
<% else %>
28-
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: @content_item.parsed_content_item, ga4_tracking: true %>
28+
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: @content_item.parsed_content_item %>
2929
<% end %>
3030
<% end %>
3131

app/views/shared/_footer_navigation.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% @contextual_footer = capture do %>
2-
<%= render 'govuk_publishing_components/components/contextual_footer', content_item: @content_item.content_item.parsed_content, ga4_tracking: true %>
2+
<%= render 'govuk_publishing_components/components/contextual_footer', content_item: @content_item.content_item.parsed_content %>
33
<% end %>
44

55
<% if @contextual_footer.present? %>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
<%
2-
content_item = @content_item.content_item.parsed_content
3-
%>
1+
<% content_item = @content_item.content_item.parsed_content %>
42

53
<div class="govuk-grid-column-one-third">
6-
<%= render 'govuk_publishing_components/components/contextual_sidebar', content_item: content_item, ga4_tracking: true %>
4+
<%= render 'govuk_publishing_components/components/contextual_sidebar', content_item: content_item %>
75
</div>

0 commit comments

Comments
 (0)