diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb
index 3d8b35f7b..dc52bde90 100644
--- a/app/views/content_items/detailed_guide.html.erb
+++ b/app/views/content_items/detailed_guide.html.erb
@@ -105,6 +105,16 @@
<%= render "govuk_publishing_components/components/print_link", {
margin_top: 0,
margin_bottom: 6,
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 1,
+ index_total: 2,
+ section: 'Contents',
+ },
+ },
} unless brexit_child_taxon %>
<% if brexit_child_taxon %>
@@ -122,6 +132,16 @@
<%= render "govuk_publishing_components/components/print_link", {
margin_top: 0,
margin_bottom: 6,
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 2,
+ index_total: 2,
+ section: 'Footer',
+ },
+ },
} unless brexit_child_taxon %>
<%= render 'shared/sidebar_navigation' %>
diff --git a/app/views/content_items/guide.html+print.erb b/app/views/content_items/guide.html+print.erb
index 25bc17063..d7b0b1255 100644
--- a/app/views/content_items/guide.html+print.erb
+++ b/app/views/content_items/guide.html+print.erb
@@ -7,7 +7,7 @@
- <%= render 'govuk_publishing_components/components/title', {
+ <%= render 'govuk_publishing_components/components/title', {
margin_bottom: 6,
title: @content_item.title,
} %>
@@ -21,10 +21,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"),
@@ -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")
} %>
diff --git a/app/views/content_items/hmrc_manual.html.erb b/app/views/content_items/hmrc_manual.html.erb
index 00144b78c..1b1368b0c 100644
--- a/app/views/content_items/hmrc_manual.html.erb
+++ b/app/views/content_items/hmrc_manual.html.erb
@@ -24,5 +24,16 @@
<% end %>
- <%= render "govuk_publishing_components/components/print_link" %>
+ <%= render 'govuk_publishing_components/components/print_link', {
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 1,
+ index_total: 1,
+ section: 'Footer',
+ },
+ },
+ } %>
diff --git a/app/views/content_items/hmrc_manual_section.html.erb b/app/views/content_items/hmrc_manual_section.html.erb
index 7f7683f76..390625ca6 100644
--- a/app/views/content_items/hmrc_manual_section.html.erb
+++ b/app/views/content_items/hmrc_manual_section.html.erb
@@ -45,5 +45,16 @@
- <%= render "govuk_publishing_components/components/print_link" %>
+ <%= render 'govuk_publishing_components/components/print_link', {
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 1,
+ index_total: 1,
+ section: 'Footer',
+ },
+ },
+ } %>
diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb
index 622d08698..9ac484472 100644
--- a/app/views/content_items/html_publication.html.erb
+++ b/app/views/content_items/html_publication.html.erb
@@ -54,9 +54,20 @@
<% if @content_item.contents.any? %>
<%= render 'govuk_publishing_components/components/contents_list', contents: @content_item.contents, format_numbers: true %>
- <%= render "govuk_publishing_components/components/print_link", {
+
+ <%= render 'govuk_publishing_components/components/print_link', {
margin_top: 0,
margin_bottom: 6,
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 1,
+ index_total: 1,
+ section: 'Contents',
+ },
+ },
} %>
<% end %>
diff --git a/app/views/content_items/manual.html.erb b/app/views/content_items/manual.html.erb
index 9824a772e..b514cef96 100644
--- a/app/views/content_items/manual.html.erb
+++ b/app/views/content_items/manual.html.erb
@@ -33,5 +33,16 @@
} %>
<% end %>
- <%= render "govuk_publishing_components/components/print_link" %>
+ <%= render 'govuk_publishing_components/components/print_link', {
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 1,
+ index_total: 1,
+ section: 'Footer',
+ },
+ },
+ } %>
diff --git a/app/views/content_items/manual_section.html.erb b/app/views/content_items/manual_section.html.erb
index a9a0802d8..039cd31d7 100644
--- a/app/views/content_items/manual_section.html.erb
+++ b/app/views/content_items/manual_section.html.erb
@@ -96,5 +96,16 @@
- <%= render "govuk_publishing_components/components/print_link" %>
+ <%= render 'govuk_publishing_components/components/print_link', {
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 1,
+ index_total: 1,
+ section: 'Footer',
+ },
+ },
+ } %>
diff --git a/app/views/content_items/manuals/_updates.html.erb b/app/views/content_items/manuals/_updates.html.erb
index 06e8c6531..75f533b5f 100644
--- a/app/views/content_items/manuals/_updates.html.erb
+++ b/app/views/content_items/manuals/_updates.html.erb
@@ -70,4 +70,15 @@
-<%= render "govuk_publishing_components/components/print_link" %>
+<%= render 'govuk_publishing_components/components/print_link', {
+ data_attributes: {
+ module: "ga4-event-tracker",
+ ga4: {
+ event_name: 'print_page',
+ type: 'Print this page',
+ index: 1,
+ index_total: 1,
+ section: 'Footer',
+ },
+ },
+} %>
diff --git a/app/views/content_items/travel_advice.html+print.erb b/app/views/content_items/travel_advice.html+print.erb
index 0e3502bee..e0f3ab0ba 100644
--- a/app/views/content_items/travel_advice.html+print.erb
+++ b/app/views/content_items/travel_advice.html+print.erb
@@ -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"),
@@ -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")
} %>