Skip to content

Commit

Permalink
Add scroll tracking to homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
andysellick committed Jan 22, 2024
1 parent deeb15f commit b979458
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/homepage/_government_activity.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
font_size: "l",
text: t("homepage.index.government_activity"),
margin_bottom: 2,
data_attributes: {
ga4_scroll_marker: true,
},
} %>
</div>

Expand Down
3 changes: 3 additions & 0 deletions app/views/homepage/_more_on_govuk.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
text: t("homepage.index.more"),
margin_bottom: 6,
font_size: "l",
data_attributes: {
ga4_scroll_marker: true,
},
} %>
</div>
<ul class="homepage-most-active-list" data-module="gem-track-click ga4-link-tracker">
Expand Down
3 changes: 3 additions & 0 deletions app/views/homepage/_popular_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
font_size: "l",
margin_bottom: 6,
text: t("homepage.index.popular_links_heading"),
data_attributes: {
ga4_scroll_marker: true,
},
} %>
<ul class="homepage-most-viewed-list" data-module="gem-track-click ga4-link-tracker">
<% t("homepage.index.popular_links").each_with_index do | item, index | %>
Expand Down
3 changes: 3 additions & 0 deletions app/views/homepage/_promotion_slots.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
text: t("homepage.index.featured"),
font_size: "l",
margin_bottom: 6,
data_attributes: {
ga4_scroll_marker: true,
},
} %>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/views/homepage/_services_and_information.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
heading_level: 2,
margin_bottom: 6,
text: t("homepage.index.services_and_information"),
data_attributes: {
ga4_scroll_marker: true,
},
} %>
</div>

Expand Down
1 change: 1 addition & 0 deletions app/views/homepage/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<% content_for :extra_headers do %>
<link rel="canonical" href="<%= Frontend.govuk_website_root + root_path %>">
<meta name="description" content="<%= t("homepage.index.meta_description_new") %>">
<meta name="govuk:scroll-tracker" content="" data-module="ga4-scroll-tracker" data-ga4-track-type="markers"/>
<% end %>
<% content_for :title, t("homepage.index.intro_title.text") %>
<% content_for :body_classes, "homepage" %><%# The `homepage` body class is required for emergency banner. %>
Expand Down

0 comments on commit b979458

Please sign in to comment.