Skip to content

Commit

Permalink
Add tracking for departments link on super nav header
Browse files Browse the repository at this point in the history
  • Loading branch information
owenatgov committed Aug 9, 2021
1 parent f7822f5 commit b663492
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
useful summary for people upgrading their application, not a replication
of the commit log.

# Unreleased

* Fix final issues with tracking on super nav header ([PR #2256](https://github.com/alphagov/govuk_publishing_components/pull/2256))

# 25.2.2

* Fix typo in tracking module on super navigation header ([PR #2253](https://github.com/alphagov/govuk_publishing_components/pull/2253))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,17 @@ show_navigation_menu_text = t("components.layout_super_navigation_header.menu_to
tracking_label = link[:label].downcase.gsub(/\s+/, "")
%>
<%= tag.li class: li_classes do %>
<a class="gem-c-layout-super-navigation-header__navigation-item-link" href="<%= link[:href] %>">
<%= link[:label] %>
</a>
<%= link_to link[:label], link[:href], {
class: "gem-c-layout-super-navigation-header__navigation-item-link",
data: {
module: "gem-track-click",
track_action: "#{tracking_label}Link",
track_category: "headerClicked",
track_label: link[:href],
track_dimension: link[:label],
track_dimension_index: "29",
}
} %>
<% if has_children %>
<button
aria-controls="super-navigation-menu__section-<%= unique_id %>"
Expand Down

0 comments on commit b663492

Please sign in to comment.