Skip to content

Commit

Permalink
Remove GA4 tracking on 'print page' buttons
Browse files Browse the repository at this point in the history
We now have a tracker that tracks the browser print dialog, so we remove this tracking to prevent duplicate print events.
  • Loading branch information
AshGDS committed Dec 11, 2023
1 parent c35133a commit 6cb470a
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 98 deletions.
10 changes: 0 additions & 10 deletions app/views/content_items/detailed_guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
16 changes: 0 additions & 16 deletions app/views/content_items/guide.html+print.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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")
} %>
Expand Down
10 changes: 0 additions & 10 deletions app/views/content_items/html_publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
} %>
</div>
<% end %>
Expand Down
13 changes: 1 addition & 12 deletions app/views/content_items/manuals/_manual_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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', {} %>
</div>
<% end %>
13 changes: 1 addition & 12 deletions app/views/content_items/manuals/_manual_section_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@
</div>
</div>

<%= 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', {} %>
</div>
<% end %>
13 changes: 1 addition & 12 deletions app/views/content_items/manuals/_updates.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,4 @@
</div>
</div>

<%= 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', {} %>
16 changes: 0 additions & 16 deletions app/views/content_items/travel_advice.html+print.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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")
} %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
} %>
</div>

0 comments on commit 6cb470a

Please sign in to comment.