Skip to content

Commit

Permalink
Add GA4 tracking for travel advice
Browse files Browse the repository at this point in the history
  • Loading branch information
andysellick committed Aug 19, 2022
1 parent dfdca9d commit ec173c2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions app/views/content_items/travel_advice.html+print.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@

<%= render 'govuk_publishing_components/components/print_link', {
data_attributes: {
module: "ga4-event-tracker",
"track-category": "printButton",
"track-action": "clicked",
"track-label": t("components.print_link.text"),
module: "print-link"
ga4: {
event_name: 'print_page',
type: 'Print this page',
index: 1,
index_total: 2,
section: 'Contents',
},
},
margin_bottom: 8,
text: t("components.print_link.text"),
Expand All @@ -45,10 +52,17 @@

<%= render 'govuk_publishing_components/components/print_link', {
data_attributes: {
module: "ga4-event-tracker",
"track-category": "printButton",
"track-action": "clicked",
"track-label": t("components.print_link.text"),
module: "print-link"
ga4: {
event_name: 'print_page',
type: 'Print this page',
index: 2,
index_total: 2,
section: 'Footer',
},
},
text: t("components.print_link.text")
} %>
Expand Down

0 comments on commit ec173c2

Please sign in to comment.