Skip to content

Commit

Permalink
Merge pull request #1812 from alphagov/remove-ua
Browse files Browse the repository at this point in the history
Remove Universal Analytics
  • Loading branch information
AshGDS authored Jul 5, 2024
2 parents c7e7363 + 6ccd987 commit 0b7cb78
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 194 deletions.
2 changes: 0 additions & 2 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
//= require govuk_publishing_components/components/details
//= require govuk_publishing_components/components/error-summary
//= require govuk_publishing_components/components/radio

//= require_tree ./modules
45 changes: 0 additions & 45 deletions app/assets/javascripts/modules/track-email-alert-signup-choices.js

This file was deleted.

8 changes: 1 addition & 7 deletions app/views/account_subscriptions/confirm.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@
<%= hidden_field_tag "return_to_url", @return_to_url %>
<%= render "govuk_publishing_components/components/button", {
text: t("account_subscriptions.confirm.confirm"),
margin_bottom: 4,
data_attributes: {
module: "gem-track-click",
track_category: "email_subscriptions",
track_action: "new_account",
track_label: @subscriber_list["title"],
},
margin_bottom: 4
} %>
<% end %>

Expand Down
8 changes: 1 addition & 7 deletions app/views/content_item_signups/confirm.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@
<% end %>
<%= render 'govuk_publishing_components/components/button', {
text: 'Continue',
margin_bottom: true,
data_attributes: {
module: 'gem-track-click',
track_category: 'email_subscriptions',
track_action: 'new_frequency',
track_label: @content_item['title'],
},
margin_bottom: true
} %>
<% end %>
6 changes: 2 additions & 4 deletions app/views/content_item_signups/taxon.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@
<%= form_tag({ action: :confirm },
method: "get",
data: {
module: "track-email-alert-signup-choices ga4-form-tracker",
ga4_form: ga4_data,
track_action: "new_topic",
track_category: "email_subscriptions",
module: "ga4-form-tracker",
ga4_form: ga4_data
}) do %>
<%
Expand Down
5 changes: 1 addition & 4 deletions app/views/govuk_account_signups/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
<%= render "govuk_publishing_components/components/button", {
text: t("single_page_subscriptions.create_or_sign_in_description"),
data_attributes: {
module: "gem-track-click ga4-link-tracker",
track_action: t("single_page_subscriptions.create_or_sign_in_description"),
track_category: "External link clicked",
track_label: @topic_id,
module: "ga4-link-tracker",
ga4_link: {
"event_name": "navigation",
"type": "generic link",
Expand Down
7 changes: 1 addition & 6 deletions app/views/subscriber_authentication/sign_in.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@
<%= render 'govuk_publishing_components/components/button', {
text: 'Continue',
margin_bottom: true,
data_attributes: {
module: 'auto-track-event',
track_category: 'email_subscriptions',
track_action: 'authenticate',
},
margin_bottom: true
} %>
<%- end -%>
8 changes: 1 addition & 7 deletions app/views/subscriptions/new_address.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@
<%= render "govuk_publishing_components/components/button", {
text: "Continue",
margin_bottom: true,
data_attributes: {
module: 'gem-track-click',
track_category: 'email_subscriptions',
track_action: 'new_email_confirm',
track_label: "#{@topic_id} #{@frequency}",
},
margin_bottom: true
} %>
<% end %>
4 changes: 1 addition & 3 deletions app/views/subscriptions/new_frequency.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
<%= form_tag(subscription_frequency_path,
class: "checklist-email-signup",
data: {
module: "track-email-alert-signup-choices ga4-form-tracker",
track_category: "email_subscriptions",
track_action: 'new_address',
module: "ga4-form-tracker",
ga4_form: ga4_data
}) do %>
<%= hidden_field_tag :topic_id, @topic_id %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
<%= hidden_field_tag(:from, @from) %>
<%= render 'govuk_publishing_components/components/button', {
text: 'Unsubscribe',
margin_bottom: true,
data_attributes: {
module: 'auto-track-event',
track_category: 'email_subscriptions',
track_action: 'unsubscribe_all',
},
margin_bottom: true
} %>
<% end %>
<p class="govuk-body">
Expand Down
22 changes: 2 additions & 20 deletions app/views/subscriptions_management/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,15 @@
<% end %>
<%= link_to change_frequency_link_text,
update_frequency_path(id: subscription['id']),
class: %w[govuk-link govuk-link--no-visited-state],
data: {
module: "gem-track-click",
track_category: "Manage_your_email_subscriptions",
track_action: "Change-frequency",
track_label: use_govuk_account_layout? ? "From_specific_logged_in" : "From_specific_logged_out",
} %>
class: %w[govuk-link govuk-link--no-visited-state] %>
</p>
<p class="govuk-body">
<% unsubscribe_link_text = capture do %>
Unsubscribe <span class="govuk-visually-hidden"> from <%= subscription['subscriber_list']['title'] %></span>
<% end %>
<%= link_to unsubscribe_link_text,
confirm_unsubscribe_path(id: subscription['id']),
class: %w[govuk-link govuk-link--no-visited-state],
data: {
module: "gem-track-click",
track_category: "Manage_your_email_subscriptions",
track_action: "Unsubscribe",
track_label: use_govuk_account_layout? ? "From_specific_logged_in" : "From_specific_logged_out",
} %>
class: %w[govuk-link govuk-link--no-visited-state] %>
</p>

<hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">
Expand All @@ -141,12 +129,6 @@
<%= render "govuk_publishing_components/components/button", {
text: "Unsubscribe from everything",
href: confirm_unsubscribe_all_path,
data_attributes: {
module: "gem-track-click",
track_category: "Manage_your_email_subscriptions",
track_action: "Unsubscribe",
track_label: use_govuk_account_layout? ? "From_everything_logged_in" : "From_everything_logged_out",
},
secondary_solid: true
} %>
</p>
Expand Down
9 changes: 2 additions & 7 deletions app/views/subscriptions_management/update_address.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
change_address_path,
method: :post,
data: {
module: "track-email-alert-signup-choices ga4-form-tracker",
module: "ga4-form-tracker",
ga4_form: ga4_data,
}) do %>
<%= render 'govuk_publishing_components/components/input', {
Expand All @@ -77,12 +77,7 @@
<% end %>
<%= render 'govuk_publishing_components/components/button', {
text: 'Save',
margin_bottom: true,
data_attributes: {
module: 'auto-track-event',
track_category: 'email_subscriptions',
track_action: 'update_address',
},
margin_bottom: true
} %>
<%- end -%>
<p class="govuk-body">
Expand Down
8 changes: 1 addition & 7 deletions app/views/subscriptions_management/update_frequency.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@
<%= render 'govuk_publishing_components/components/button', {
text: 'Save',
margin_bottom: true,
data_attributes: {
module: 'auto-track-event',
track_category: 'email_subscriptions',
track_action: 'update_frequency',
track_label: @current_frequency,
}
margin_bottom: true
} %>
<% end %>
<p class="govuk-body">
Expand Down
8 changes: 1 addition & 7 deletions app/views/unsubscriptions/confirm.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@
<%= render 'govuk_publishing_components/components/button', {
text: 'Unsubscribe',
margin_bottom: true,
data_attributes: {
module: 'auto-track-event',
track_category: 'email_subscriptions',
track_action: 'unsubscribe_list',
track_label: @title,
},
margin_bottom: true
} %>
<% end %>
Expand Down
10 changes: 10 additions & 0 deletions spec/javascripts/modules/dummy-test.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* We want to keep the jasmine/standardx functionality for tests in this repo, however they both crash if no JS spec files exist.
* Therefore we can keep this dummy test in. It can be removed if real tests are written for something in the future.
*/

describe('dummy test', function () {
it('accepts the truth', function () {
expect(true).toBe(true)
})
})
62 changes: 0 additions & 62 deletions spec/javascripts/modules/track-email-alert-signup-choices.spec.js

This file was deleted.

0 comments on commit 0b7cb78

Please sign in to comment.