Skip to content

Commit ec173c2

Browse files
committed
Add GA4 tracking for travel advice
1 parent dfdca9d commit ec173c2

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

app/views/content_items/travel_advice.html+print.erb

+16-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@
2020

2121
<%= render 'govuk_publishing_components/components/print_link', {
2222
data_attributes: {
23+
module: "ga4-event-tracker",
2324
"track-category": "printButton",
2425
"track-action": "clicked",
2526
"track-label": t("components.print_link.text"),
26-
module: "print-link"
27+
ga4: {
28+
event_name: 'print_page',
29+
type: 'Print this page',
30+
index: 1,
31+
index_total: 2,
32+
section: 'Contents',
33+
},
2734
},
2835
margin_bottom: 8,
2936
text: t("components.print_link.text"),
@@ -45,10 +52,17 @@
4552

4653
<%= render 'govuk_publishing_components/components/print_link', {
4754
data_attributes: {
55+
module: "ga4-event-tracker",
4856
"track-category": "printButton",
4957
"track-action": "clicked",
5058
"track-label": t("components.print_link.text"),
51-
module: "print-link"
59+
ga4: {
60+
event_name: 'print_page',
61+
type: 'Print this page',
62+
index: 2,
63+
index_total: 2,
64+
section: 'Footer',
65+
},
5266
},
5367
text: t("components.print_link.text")
5468
} %>

0 commit comments

Comments
 (0)