Skip to content

Commit

Permalink
Fix tracking Travel Advice links twice
Browse files Browse the repository at this point in the history
There is a bug where these navigation links are sending two GA events
per click. This is occurring because the contents-list component has an
undocumented [1] feature of tracking links which was presumably not
known about when this code was changed to use this component [2].

The resolution for this is to remove the usage of track links on the nav
element and just use the components one.

[1]: https://github.com/alphagov/govuk_publishing_components/blob/147a825fc7608eb3dfdaab0d418c5b2fdaaf08aa/app/views/govuk_publishing_components/components/docs/contents_list.yml
[2]: #1877
  • Loading branch information
kevindew committed Aug 6, 2021
1 parent 567a0e3 commit e87f161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/content_items/travel_advice.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>

<aside class="part-navigation-container" role="complementary">
<nav role="navigation" class="govuk-grid-row part-navigation" aria-label="Travel advice pages" data-module="gem-track-click">
<nav role="navigation" class="govuk-grid-row part-navigation" aria-label="Travel advice pages">
<%= render "govuk_publishing_components/components/contents_list", contents: @content_item.part_link_elements, underline_links: true %>
</nav>

Expand Down

0 comments on commit e87f161

Please sign in to comment.