Skip to content

Commit

Permalink
Merge pull request #3404 from alphagov/ga4-subscribe-link-fix
Browse files Browse the repository at this point in the history
Prevent "latest changes" link from being tracked as an email subscription link
  • Loading branch information
AshGDS authored Oct 3, 2023
2 parents 899a105 + f2d6a7d commit e84a089
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/views/subtopics/_subtopic.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
<% end %>
</div>

<div
class="govuk-grid-column-one-third govuk-!-margin-top-8 govuk-!-margin-bottom-3"
data-module="ga4-link-tracker"
data-ga4-link='{ "event_name": "navigation", "type": "subscribe", "index": { "index_link": 1 }, "index_total": 1, "section": "Top" }'
data-ga4-track-links-only
>
<%= render "govuk_publishing_components/components/subscription_links", {
email_signup_link: "/email-signup?link=/topic/#{params[:topic_slug]}/#{params[:subtopic_slug]}",
email_signup_link_text: t("shared.get_emails")
} %>

<div class="govuk-grid-column-one-third govuk-!-margin-top-8 govuk-!-margin-bottom-3">
<span
data-module="ga4-link-tracker"
data-ga4-link='{ "event_name": "navigation", "type": "subscribe", "index": { "index_link": 1 }, "index_total": 1, "section": "Top" }'
data-ga4-track-links-only
>
<%= render "govuk_publishing_components/components/subscription_links", {
email_signup_link: "/email-signup?link=/topic/#{params[:topic_slug]}/#{params[:subtopic_slug]}",
email_signup_link_text: t("shared.get_emails")
} %>
</span>
<% if local_assigns[:link_to_latest_feed] %>
<div class="topics-page__latest">
<%= link_to t("subtopics.get_latest"), latest_changes_path(topic_slug: params[:topic_slug], subtopic_slug: params[:subtopic_slug]), class: "govuk-link topics-page__latest-link" %>
Expand Down

0 comments on commit e84a089

Please sign in to comment.