From 6cb470a1b277f13e196bb14c8d8d0c771fcefa6a Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:26:54 +0000 Subject: [PATCH] Remove GA4 tracking on 'print page' buttons We now have a tracker that tracks the browser print dialog, so we remove this tracking to prevent duplicate print events. --- app/views/content_items/detailed_guide.html.erb | 10 ---------- app/views/content_items/guide.html+print.erb | 16 ---------------- .../content_items/html_publication.html.erb | 10 ---------- .../manuals/_manual_layout.html.erb | 13 +------------ .../manuals/_manual_section_layout.html.erb | 13 +------------ .../content_items/manuals/_updates.html.erb | 13 +------------ .../content_items/travel_advice.html+print.erb | 16 ---------------- ...ished_dates_with_notification_button.html.erb | 10 ---------- 8 files changed, 3 insertions(+), 98 deletions(-) diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb index ad0365a54c..d8871bb293 100644 --- a/app/views/content_items/detailed_guide.html.erb +++ b/app/views/content_items/detailed_guide.html.erb @@ -86,16 +86,6 @@ <%= render "govuk_publishing_components/components/print_link", { margin_top: 0, margin_bottom: 6, - data_attributes: { - module: "ga4-event-tracker", - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 1, - index_total: 2, - section: 'Content', - }, - }, } %> <%= render 'govuk_publishing_components/components/govspeak', {} do %> diff --git a/app/views/content_items/guide.html+print.erb b/app/views/content_items/guide.html+print.erb index 1101d48566..4647b5d89b 100644 --- a/app/views/content_items/guide.html+print.erb +++ b/app/views/content_items/guide.html+print.erb @@ -22,17 +22,9 @@ <%= 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"), - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 1, - index_total: 2, - section: 'Content', - }, }, margin_bottom: 8, text: t("components.print_link.text"), @@ -53,17 +45,9 @@ <%= 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"), - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 2, - index_total: 2, - section: 'Footer', - }, }, text: t("components.print_link.text") } %> diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb index 3f1f4673c0..d968b38f27 100644 --- a/app/views/content_items/html_publication.html.erb +++ b/app/views/content_items/html_publication.html.erb @@ -64,16 +64,6 @@ <%= render 'govuk_publishing_components/components/print_link', { margin_top: 0, margin_bottom: 6, - data_attributes: { - module: "ga4-event-tracker", - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 1, - index_total: 1, - section: 'Content', - }, - }, } %> <% end %> diff --git a/app/views/content_items/manuals/_manual_layout.html.erb b/app/views/content_items/manuals/_manual_layout.html.erb index c945bcc3e6..fb0f4b690e 100644 --- a/app/views/content_items/manuals/_manual_layout.html.erb +++ b/app/views/content_items/manuals/_manual_layout.html.erb @@ -17,17 +17,6 @@ <%= yield %> - <%= render 'govuk_publishing_components/components/print_link', { - data_attributes: { - module: "ga4-event-tracker", - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 1, - index_total: 1, - section: 'Footer', - }, - }, - } %> + <%= render 'govuk_publishing_components/components/print_link', {} %> <% end %> \ No newline at end of file diff --git a/app/views/content_items/manuals/_manual_section_layout.html.erb b/app/views/content_items/manuals/_manual_section_layout.html.erb index fc96b4b202..bb693152e6 100644 --- a/app/views/content_items/manuals/_manual_section_layout.html.erb +++ b/app/views/content_items/manuals/_manual_section_layout.html.erb @@ -34,17 +34,6 @@ - <%= render 'govuk_publishing_components/components/print_link', { - data_attributes: { - module: "ga4-event-tracker", - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 1, - index_total: 1, - section: 'Footer', - }, - }, - } %> + <%= render 'govuk_publishing_components/components/print_link', {} %> <% end %> diff --git a/app/views/content_items/manuals/_updates.html.erb b/app/views/content_items/manuals/_updates.html.erb index e12c6ef66c..ba22d1539d 100644 --- a/app/views/content_items/manuals/_updates.html.erb +++ b/app/views/content_items/manuals/_updates.html.erb @@ -58,15 +58,4 @@ -<%= render 'govuk_publishing_components/components/print_link', { - data_attributes: { - module: "ga4-event-tracker", - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 1, - index_total: 1, - section: 'Footer', - }, - }, -} %> +<%= render 'govuk_publishing_components/components/print_link', {} %> diff --git a/app/views/content_items/travel_advice.html+print.erb b/app/views/content_items/travel_advice.html+print.erb index 010433d61b..7d4ff303b9 100644 --- a/app/views/content_items/travel_advice.html+print.erb +++ b/app/views/content_items/travel_advice.html+print.erb @@ -21,17 +21,9 @@ <%= 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"), - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 1, - index_total: 2, - section: 'Content', - }, }, margin_bottom: 8, text: t("components.print_link.text"), @@ -53,17 +45,9 @@ <%= 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"), - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 2, - index_total: 2, - section: 'Footer', - }, }, text: t("components.print_link.text") } %> diff --git a/app/views/shared/_published_dates_with_notification_button.html.erb b/app/views/shared/_published_dates_with_notification_button.html.erb index 5caa0a2fc8..b7cb2cd574 100644 --- a/app/views/shared/_published_dates_with_notification_button.html.erb +++ b/app/views/shared/_published_dates_with_notification_button.html.erb @@ -29,16 +29,6 @@ <%= render "govuk_publishing_components/components/print_link", { margin_top: 0, margin_bottom: 8, - data_attributes: { - module: "ga4-event-tracker", - ga4_event: { - event_name: 'print_page', - type: 'print page', - index_link: 2, - index_total: 2, - section: 'Footer', - }, - }, } %>