Skip to content

Commit

Permalink
Add scroll tracking to answers
Browse files Browse the repository at this point in the history
- adds percentage scroll tracking to a selection of answer pages
  • Loading branch information
andysellick committed Dec 11, 2023
1 parent 82917e2 commit 6baaec1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/views/content_items/answer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,32 @@
scroll_track_percent_paths = [
"/get-coronavirus-test",
]
ga4_scroll_track_headings_paths = [
"/personal-tax-account",
"/log-in-file-self-assessment-tax-return",
"/benefits-calculators",
"/national-minimum-wage-rates",
"/order-coronavirus-rapid-lateral-flow-tests",
"/contact-hmrc",
"/dbs-update-service",
"/tax-free-childcare",
"/check-income-tax-current-year",
"/apply-apprenticeship",
"/report-covid19-result",
"/order-copy-birth-death-marriage-certificate",
"/global-health-insurance-card"
]
%>
<% if scroll_track_headings_paths.include?(@content_item.base_path) %>
<meta name="govuk:scroll-tracker" content="" data-module="auto-scroll-tracker" data-track-type="headings"/>
<% elsif scroll_track_percent_paths.include?(@content_item.base_path) %>
<meta name="govuk:scroll-tracker" content="" data-module="auto-scroll-tracker"/>
<% end %>

<% if ga4_scroll_track_headings_paths.include?(@content_item.base_path) %>
<meta name="govuk:scroll-tracker" content="" data-module="ga4-scroll-tracker"/>
<% end %>

<%= @requested_variant.analytics_meta_tag.html_safe if @requested_variant.present? %>
<% end %>

Expand Down

0 comments on commit 6baaec1

Please sign in to comment.