Skip to content

Commit

Permalink
Merge pull request #2992 from alphagov/remove-ga4-tracking-true
Browse files Browse the repository at this point in the history
Remove ga4_tracking: true component options
  • Loading branch information
andysellick authored Nov 20, 2023
2 parents 4cad974 + 6500698 commit 1b47328
Show file tree
Hide file tree
Showing 28 changed files with 19 additions and 55 deletions.
1 change: 0 additions & 1 deletion app/helpers/service_manual_phase_label_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/_contents_list_with_body.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div id="contents" class="app-c-contents-list-with-body"<%= sticky_attr %>>
<% if contents.any? %>
<div class="responsive-bottom-margin">
<%= render 'govuk_publishing_components/components/contents_list', contents: contents, ga4_tracking: true %>
<%= render 'govuk_publishing_components/components/contents_list', contents: contents %>
</div>
<% end %>
<%= block %>
Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/call_for_evidence.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
type: @content_item.schema_name,
ga4_tracking: true,
} %>
<% end %>

Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/consultation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
type: @content_item.schema_name,
ga4_tracking: true,
} %>
<% end %>

Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/detailed_guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
type: @content_item.schema_name,
ga4_tracking: true,
} %>
<% end %>

Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/field_of_operation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<div class="govuk-grid-column-one-third">
<%= render "govuk_publishing_components/components/contents_list", {
contents: @content_item.contents,
ga4_tracking: true
} %>
</div>
<% end %>
Expand Down
8 changes: 2 additions & 6 deletions app/views/content_items/guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
href: "#guide-contents"
} %>
<aside class="part-navigation-container" role="complementary">
<%= 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 %>
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("guide.pages_in_guide") }, contents: @content_item.part_link_elements, underline_links: true %>
</aside>
<% end %>
</div>
Expand All @@ -73,11 +73,7 @@
<% end %>

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

<div class="responsive-bottom-margin">
<a href="<%= @content_item.print_link %>"
Expand Down
2 changes: 1 addition & 1 deletion app/views/content_items/guide_single.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<% if @content_item.show_guide_navigation? %>
<aside class="part-navigation-container" role="complementary">
<%= 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 %>
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("guide.pages_in_guide") }, contents: @content_item.part_link_elements, underline_links: true %>
</aside>
<% end %>
</div>
Expand Down
8 changes: 2 additions & 6 deletions app/views/content_items/hmrc_manual_section.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
heading_level: 1,
margin_bottom: 6,
green_background: true,
type: I18n.t("manuals.hmrc_manual_type"),
type: I18n.t("manuals.hmrc_manual_type"),
} %>
<% end %>

Expand All @@ -25,10 +25,6 @@
<% end %>

<div class="govuk-grid-column-full">
<%
previous_and_next_with_ga4_tracking = { ga4_tracking: true }
previous_and_next_with_ga4_tracking.merge!(@content_item.previous_and_next_links) # @content_item is frozen so we make a new hash
%>
<%= render "govuk_publishing_components/components/previous_and_next_navigation", previous_and_next_with_ga4_tracking %>
<%= render "govuk_publishing_components/components/previous_and_next_navigation", @content_item.previous_and_next_links %>
</div>
<% end %>
1 change: 0 additions & 1 deletion app/views/content_items/how_government_works.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
text: "History of government",
}
],
ga4_tracking: true
} %>
</div>

Expand Down
3 changes: 1 addition & 2 deletions app/views/content_items/html_publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
type: @content_item.schema_name,
ga4_tracking: true,
} %>
<% end %>

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

<%= render 'govuk_publishing_components/components/print_link', {
margin_top: 0,
Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/manual_section.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
%>

<%= render "govuk_publishing_components/components/accordion", {
ga4_tracking: true,
anchor_navigation: true,
items: items,
} %>
Expand Down
7 changes: 1 addition & 6 deletions app/views/content_items/manuals/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@
margin_bottom: margin_bottom,
} %>

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

<div class="in-manual-search">
<%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div id="manuals-frontend" class="manuals-frontend-body">
<% if show_contents %>
<%= render "govuk_publishing_components/components/contents_list", {
aria: { label: t("manuals.pages_in_manual_section") }, contents: @content_item.contents, underline_links: true, ga4_tracking: true
aria: { label: t("manuals.pages_in_manual_section") }, contents: @content_item.contents, underline_links: true
} %>
<% end %>

Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/manuals/_updates.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

<%= render "govuk_publishing_components/components/accordion", {
heading_level: 3,
ga4_tracking: true,
items: updates_by_year.each.with_index(1).map do |updated_documents, index|
accordion_content = capture do %>
<% change_notes = updated_documents.last %>
Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<%= render "govuk_publishing_components/components/devolved_nations", {
national_applicability: @content_item.national_applicability,
type: @content_item.schema_name,
ga4_tracking: true,
} %>
<% end %>

Expand Down
1 change: 0 additions & 1 deletion app/views/content_items/service_manual_topic.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<% if @content_item.display_as_accordion? %>
<% items = @content_item.accordion_content %>
<%= render "govuk_publishing_components/components/accordion", {
ga4_tracking: true,
items: items,
} %>
<% else %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/content_items/statistics_announcement.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
<% end %>
</div>
<div class="govuk-grid-column-one-third">
<%= render 'govuk_publishing_components/components/related_navigation', content_item: @content_item.content_item.parsed_content, context: :sidebar, ga4_tracking: true %>
<%= render 'govuk_publishing_components/components/related_navigation', content_item: @content_item.content_item.parsed_content, context: :sidebar %>
</div>
</div>
8 changes: 2 additions & 6 deletions app/views/content_items/travel_advice.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<% end %>

<aside class="part-navigation-container" role="complementary">
<%= 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 %>
<%= render "govuk_publishing_components/components/contents_list", aria: { label: t("travel_advice.pages") }, contents: @content_item.part_link_elements, underline_links: true %>

<div
data-module="ga4-link-tracker"
Expand Down Expand Up @@ -63,11 +63,7 @@
<% end %>
</div>

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

<div class="responsive-bottom-margin">
<a href="<%= @content_item.print_link %>"
Expand Down
5 changes: 2 additions & 3 deletions app/views/content_items/worldwide_office.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
<article class="govuk-grid-row">
<div class="govuk-grid-column-one-third">
<%= render "govuk_publishing_components/components/contents_list",
contents: @content_item.contents,
underline_links: true,
ga4_tracking: true
contents: @content_item.contents,
underline_links: true
%>
</div>

Expand Down
1 change: 0 additions & 1 deletion app/views/histories/10_downing_street.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
text: "Larry, Chief Mouser to the Cabinet&nbsp;Office".html_safe,
},
],
ga4_tracking: true
} %>
</nav>

Expand Down
1 change: 0 additions & 1 deletion app/views/histories/11_downing_street.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
text: "Sir John Soane",
},
],
ga4_tracking: true
} %>
</nav>

Expand Down
1 change: 0 additions & 1 deletion app/views/histories/1_horse_guards_road.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
text: "The Cabinet War Rooms",
},
],
ga4_tracking: true
} %>
</nav>
<div class="govuk-grid-column-two-thirds">
Expand Down
1 change: 0 additions & 1 deletion app/views/histories/king_charles_street.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
text: "Fine Rooms",
},
],
ga4_tracking: true
} %>
</nav>

Expand Down
1 change: 0 additions & 1 deletion app/views/histories/lancaster_house.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
text: "Contact details",
},
],
ga4_tracking: true
} %>
</nav>

Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<% if @content_item.show_phase_banner? %>
<%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase, ga4_tracking: true %>
<%= render 'govuk_publishing_components/components/phase_banner', phase: @content_item.phase %>
<% end %>
<% if @content_item.service_manual? %>
<%= render_phase_label @content_item, content_for(:phase_message) %>
Expand All @@ -25,7 +25,7 @@
<% if @content_item.try(:back_link) %>
<%= render 'govuk_publishing_components/components/back_link', href: @content_item.back_link %>
<% else %>
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: @content_item.parsed_content_item, ga4_tracking: true %>
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: @content_item.parsed_content_item %>
<% end %>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_footer_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% @contextual_footer = capture do %>
<%= render 'govuk_publishing_components/components/contextual_footer', content_item: @content_item.content_item.parsed_content, ga4_tracking: true %>
<%= render 'govuk_publishing_components/components/contextual_footer', content_item: @content_item.content_item.parsed_content %>
<% end %>

<% if @contextual_footer.present? %>
Expand Down
6 changes: 2 additions & 4 deletions app/views/shared/_sidebar_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%
content_item = @content_item.content_item.parsed_content
%>
<% content_item = @content_item.content_item.parsed_content %>

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

0 comments on commit 1b47328

Please sign in to comment.