Skip to content

Commit

Permalink
Merge pull request #1359 from alphagov/add-tracking-to-next-prev-links
Browse files Browse the repository at this point in the history
Add tracking module to next/prev component
  • Loading branch information
sihugh authored Mar 29, 2018
2 parents e4c888f + 8c0ffb8 commit 3242945
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@
role="navigation"
aria-label="<%= t("govuk_component.previous_and_next_navigation.pagination", default: "Pagination") %>"
>
<ul class="pub-c-pagination__list">
<ul class="pub-c-pagination__list" data-module="track-click">
<% if local_assigns.include?(:previous_page) %>
<li class="pub-c-pagination__item pub-c-pagination__item--previous">
<a href="<%= previous_page[:url] %>" class="pub-c-pagination__link" rel="prev">
<a href="<%= previous_page[:url] %>"
class="pub-c-pagination__link"
rel="prev"
data-track-category="contentsClicked"
data-track-action="previous"
data-track-label="<%= previous_page[:url] %>"
data-track-dimension="previous"
data-track-dimension-index="29"
>
<span class="pub-c-pagination__link-title">
<svg class="pub-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
<path fill="currentColor" d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"/>
Expand All @@ -23,7 +31,15 @@
<% end %>
<% if local_assigns.include?(:next_page) %>
<li class="pub-c-pagination__item pub-c-pagination__item--next">
<a href="<%= next_page[:url] %>" class="pub-c-pagination__link" rel="next">
<a href="<%= next_page[:url] %>"
class="pub-c-pagination__link"
rel="next"
data-track-category="contentsClicked"
data-track-action="next"
data-track-label="<%= next_page[:url] %>"
data-track-dimension="next"
data-track-dimension-index="29"
>
<span class="pub-c-pagination__link-title">
<%= next_page[:title] %>
<svg class="pub-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
Expand Down

0 comments on commit 3242945

Please sign in to comment.