govuk_publishing_components 40.0.0 → 41.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -79
  3. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -34
  4. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +0 -17
  5. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +0 -6
  6. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +0 -7
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +8 -74
  8. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +0 -4
  9. data/app/assets/javascripts/govuk_publishing_components/domain-config.js +0 -8
  10. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +0 -4
  11. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +0 -14
  12. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +0 -20
  13. data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +0 -33
  14. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +0 -25
  15. data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -8
  16. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  17. data/app/views/govuk_publishing_components/components/_cards.html.erb +3 -11
  18. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +2 -15
  19. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -19
  20. data/app/views/govuk_publishing_components/components/_details.html.erb +9 -11
  21. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -5
  22. data/app/views/govuk_publishing_components/components/_intervention.html.erb +4 -4
  23. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -21
  24. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -26
  25. data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -5
  26. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +2 -7
  27. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +0 -10
  28. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +1 -3
  29. data/app/views/govuk_publishing_components/components/_search.html.erb +3 -1
  30. data/app/views/govuk_publishing_components/components/_select.html.erb +1 -2
  31. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -10
  32. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +0 -1
  33. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +1 -1
  34. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -24
  35. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -14
  36. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -4
  37. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +0 -1
  38. data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +1 -7
  39. data/app/views/govuk_publishing_components/components/docs/accordion.yml +1 -60
  40. data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -6
  41. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +0 -1
  42. data/app/views/govuk_publishing_components/components/docs/button.yml +1 -1
  43. data/app/views/govuk_publishing_components/components/docs/cards.yml +3 -13
  44. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +0 -33
  45. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
  46. data/app/views/govuk_publishing_components/components/docs/details.yml +0 -15
  47. data/app/views/govuk_publishing_components/components/docs/document_list.yml +11 -18
  48. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -1
  49. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +0 -11
  50. data/app/views/govuk_publishing_components/components/docs/image_card.yml +0 -31
  51. data/app/views/govuk_publishing_components/components/docs/intervention.yml +0 -26
  52. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +2 -2
  53. data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +0 -2
  54. data/app/views/govuk_publishing_components/components/docs/option_select.yml +4 -16
  55. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +0 -15
  56. data/app/views/govuk_publishing_components/components/docs/print_link.yml +2 -9
  57. data/app/views/govuk_publishing_components/components/docs/search.yml +12 -0
  58. data/app/views/govuk_publishing_components/components/docs/select.yml +0 -36
  59. data/app/views/govuk_publishing_components/components/docs/share_links.yml +2 -4
  60. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +2 -25
  61. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +0 -23
  62. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +0 -10
  63. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +3 -15
  64. data/app/views/govuk_publishing_components/components/docs/table.yml +1 -1
  65. data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
  66. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +3 -27
  67. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +1 -5
  68. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +0 -2
  69. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +0 -10
  70. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  71. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +1 -5
  72. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +0 -7
  73. data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -19
  74. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +1 -15
  75. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +2 -24
  76. data/lib/govuk_publishing_components/presenters/select_helper.rb +0 -4
  77. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +0 -5
  78. data/lib/govuk_publishing_components/presenters/translation_nav_helper.rb +0 -7
  79. data/lib/govuk_publishing_components/version.rb +1 -1
  80. metadata +3 -25
  81. data/app/assets/javascripts/govuk_publishing_components/analytics/analytics.js +0 -92
  82. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +0 -221
  83. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-track-event.js +0 -30
  84. data/app/assets/javascripts/govuk_publishing_components/analytics/cross-domain-tracking.js +0 -55
  85. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +0 -133
  86. data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +0 -46
  87. data/app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js +0 -101
  88. data/app/assets/javascripts/govuk_publishing_components/analytics/error-tracking.js +0 -51
  89. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +0 -88
  90. data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +0 -68
  91. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +0 -220
  92. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +0 -60
  93. data/app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js +0 -135
  94. data/app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js +0 -43
  95. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +0 -160
  96. data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +0 -115
  97. data/app/assets/javascripts/govuk_publishing_components/analytics/print-intent.js +0 -39
  98. data/app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js +0 -132
  99. data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +0 -75
  100. data/app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js +0 -56
  101. data/app/assets/javascripts/govuk_publishing_components/analytics.js +0 -23
  102. data/app/assets/javascripts/govuk_publishing_components/components/details.js +0 -48
@@ -122,29 +122,6 @@ examples:
122
122
  ]
123
123
  },
124
124
  ]
125
- with_unique_tracking:
126
- description: |
127
- In order to identify the step by step navigation the component is part of, we need to track a unique ID of the navigation in Universal Analytics. This ID should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the ID of the step nav page.
128
-
129
- This includes show/hide all, show/hide step and any link clicks.
130
- data:
131
- tracking_id: 'this-is-the-tracking-id'
132
- steps: [
133
- {
134
- title: 'Unique tracking id',
135
- contents: [
136
- {
137
- type: 'list',
138
- contents: [
139
- {
140
- href: '#',
141
- text: 'This is a link'
142
- }
143
- ]
144
- }
145
- ]
146
- }
147
- ]
148
125
  with_a_different_heading_level:
149
126
  description: Steps have a `h2` by default, but this can be changed. The heading level does not change any styling.
150
127
  data:
@@ -573,8 +550,8 @@ examples:
573
550
  description: |
574
551
  Steps can be optional. This is controlled by two parameters, 'optional' and 'logic'.
575
552
 
576
- - Optional steps used to have a dotted line down the side but this was removed as it confused users. In some cases we may still need to record if a step is optional, so if this parameter is applied, Google Analytics tracking events will have 'optional' appended to the end of the eventLabel.
577
- - Logic will change the number next to a step to the word 'and' or the word 'or'.
553
+ - Optional steps used to have a dotted line down the side but this was removed as it confused users
554
+ - Logic will change the number next to a step to the word 'and' or the word 'or'
578
555
 
579
556
  If a step is optional this should be conveyed by the text within that step.
580
557
  data:
@@ -28,29 +28,6 @@ examples:
28
28
  data:
29
29
  title: 'Learn to practice flexible spacing: step by step'
30
30
  margin_bottom: 9
31
- with_unique_tracking:
32
- description: In order to identify the step by step navigation the component is part of, we need to track a unique `ID` of the navigation in Google Analytics. This `ID` should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the `ID` of the step nav that the component links to.
33
- data:
34
- title: 'With a tracking id'
35
- path: '#'
36
- tracking_id: 'this-is-the-tracking-id'
37
- with_custom_tracking:
38
- data:
39
- title: 'With a custom tracking'
40
- path: '#'
41
- tracking_category: "customTrackingCategoryClicked"
42
- tracking_action: "customTrackingAction"
43
- tracking_label: "customTrackingLabel"
44
- tracking_dimension: "customTrackingDimension"
45
- tracking_dimension_index: "23"
46
- without_custom_dimension:
47
- data:
48
- title: 'Without custom dimensions'
49
- path: '#'
50
- tracking_category: "customTrackingCategoryClicked"
51
- tracking_action: "customTrackingAction"
52
- tracking_label: "customTrackingLabel"
53
- tracking_dimension_enabled: false
54
31
  without_ga4_tracking:
55
32
  description: Disables GA4 tracking on the header. Tracking is enabled by default. This includes the `ga4-link-tracker` module and `data-ga4-link` attributes. See the [ga4-link-tracker docs](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
56
33
  data:
@@ -52,16 +52,6 @@ examples:
52
52
  text: 'Learn to drive a motorbike: step by step'
53
53
  }
54
54
  ]
55
- with_unique_tracking:
56
- description: In order to identify the step by step navigation the component is part of, we need to track a unique ID of the navigation in Google Analytics. This ID should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the ID of the step nav that the component links to. Where there are multiple links, they will have different tracking IDs.
57
- data:
58
- links: [
59
- {
60
- href: '#',
61
- text: 'With a tracking id',
62
- tracking_id: 'this-is-the-tracking-id'
63
- }
64
- ]
65
55
  always_display_as_a_list:
66
56
  description: |
67
57
  when this component is rendered alongside an expanded step by step, we want it to render as a heading.
@@ -51,28 +51,16 @@ examples:
51
51
  brand: 'attorney-generals-office'
52
52
  email_signup_link: '/foreign-travel-advice/singapore/email-signup'
53
53
  feed_link: '/foreign-travel-advice/singapore.atom'
54
- with_tracking:
54
+ with_data_attributes_on_links:
55
55
  description: Data attributes can be passed for each link as shown.
56
56
  data:
57
57
  email_signup_link: '/foreign-travel-advice/singapore/email-signup'
58
58
  email_signup_link_data_attributes: {
59
- track_category: 'email_link_category',
60
- track_action: 1.1,
61
- track_label: 'email_link_label',
62
- track_options: {
63
- dimension28: 1,
64
- dimension29: 'dimension29EmailLink'
65
- }
59
+ an_attribute: some_value
66
60
  }
67
61
  feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
68
62
  feed_link_data_attributes: {
69
- track_category: 'feed_link_category',
70
- track_action: 1.2,
71
- track_label: 'feed_link_label',
72
- track_options: {
73
- dimension28: 7,
74
- dimension29: 'dimension29feedLink'
75
- }
63
+ an_attribute: some_value
76
64
  }
77
65
  as_small_form:
78
66
  data:
@@ -92,7 +92,7 @@ examples:
92
92
 
93
93
  The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
94
94
 
95
- Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
95
+ Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
96
96
  data:
97
97
  sortable: true
98
98
  head:
@@ -78,7 +78,7 @@ examples:
78
78
  description: |
79
79
  The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
80
80
 
81
- Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
81
+ Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
82
82
  data:
83
83
  tabs:
84
84
  - id: "tab-with-data-attributes-1"
@@ -84,7 +84,7 @@ examples:
84
84
  - locale: 'cy'
85
85
  base_path: '/cy'
86
86
  text: 'Cymraeg'
87
- with_tracking:
87
+ with_data_attributes_on_links:
88
88
  description: Data attributes can be passed for each link as shown.
89
89
  data:
90
90
  translations:
@@ -93,22 +93,12 @@ examples:
93
93
  text: 'English'
94
94
  active: true
95
95
  data_attributes:
96
- track_category: 'categoryEnglish'
97
- track_action: 1.1
98
- track_label: 'labelEnglish'
99
- track_options:
100
- dimension28: 1
101
- dimension29: 'dimension29English'
96
+ an_attribute: some_value1
102
97
  - locale: 'cy'
103
98
  base_path: '/cy'
104
99
  text: 'Cymraeg'
105
100
  data_attributes:
106
- track_category: 'categoryWelsh'
107
- track_action: 1.2
108
- track_label: 'labelWelsh'
109
- track_options:
110
- dimension28: 1
111
- dimension29: 'dimension29Welsh'
101
+ an_attribute: some_value2
112
102
  inverse:
113
103
  data:
114
104
  inverse: true
@@ -117,22 +107,8 @@ examples:
117
107
  base_path: '/en'
118
108
  text: 'English'
119
109
  active: true
120
- data_attributes:
121
- track_category: 'categoryEnglish'
122
- track_action: 1.1
123
- track_label: 'labelEnglish'
124
- track_options:
125
- dimension28: 1
126
- dimension29: 'dimension29English'
127
110
  - locale: 'cy'
128
111
  base_path: '/cy'
129
112
  text: 'Cymraeg'
130
- data_attributes:
131
- track_category: 'categoryWelsh'
132
- track_action: 1.2
133
- track_label: 'labelWelsh'
134
- track_options:
135
- dimension28: 1
136
- dimension29: 'dimension29Welsh'
137
113
  context:
138
114
  dark_background: true
@@ -5,8 +5,6 @@
5
5
  <form action="<%= absolute_links_helper.make_url_absolute('/contact/govuk/problem_reports') %>"
6
6
  id="something-is-wrong"
7
7
  class="gem-c-feedback__form js-feedback-form"
8
- data-track-category="Onsite Feedback"
9
- data-track-action="GOV.UK Send Form"
10
8
  method="post"
11
9
  hidden>
12
10
 
@@ -43,7 +41,7 @@
43
41
  } %>
44
42
 
45
43
  <%
46
- unless disable_ga4
44
+ unless disable_ga4
47
45
  heading_text = t("components.feedback.help_us_improve_govuk", locale: :en)
48
46
  ga4_submit_button_event = {
49
47
  event_name: "form_submit",
@@ -64,8 +62,6 @@
64
62
 
65
63
  <button
66
64
  class="govuk-button govuk-button--secondary gem-c-feedback__close gem-c-feedback__js-show js-close-form"
67
- data-track-category="Onsite Feedback"
68
- data-track-action="GOV.UK Close Form"
69
65
  aria-controls="something-is-wrong"
70
66
  aria-expanded="true">
71
67
  <%= t("components.feedback.close") %>
@@ -14,8 +14,6 @@
14
14
  </p>
15
15
  <button
16
16
  class="govuk-button govuk-button--secondary js-close-form"
17
- data-track-category="yesNoFeedbackForm"
18
- data-track-action="ffFormClose"
19
17
  aria-controls="page-is-not-useful"
20
18
  aria-expanded="true"
21
19
  hidden>
@@ -37,10 +37,6 @@
37
37
  <% # Maybe button exists only to try and capture clicks by bots %>
38
38
  <%= link_to "/contact/govuk", {
39
39
  class: 'gem-c-feedback__prompt-link',
40
- data: {
41
- 'track-category' => 'yesNoFeedbackForm',
42
- 'track-action' => 'ffMaybeClick'
43
- },
44
40
  role: 'button',
45
41
  hidden: 'hidden',
46
42
  'aria-hidden': 'true',
@@ -52,8 +48,6 @@
52
48
  <%= tag.button(
53
49
  class: "govuk-button gem-c-feedback__prompt-link js-page-is-useful",
54
50
  data: {
55
- track_category: "yesNoFeedbackForm",
56
- track_action: "ffYesClick",
57
51
  ga4_event: ga4_yes_button_event,
58
52
  }) do %>
59
53
  <%= t("components.feedback.yes") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_useful") %></span>
@@ -68,8 +62,6 @@
68
62
  expanded: "false",
69
63
  },
70
64
  data: {
71
- track_category: "yesNoFeedbackForm",
72
- track_action: "ffNoClick",
73
65
  ga4_event: ga4_no_button_event,
74
66
  }) do %>
75
67
  <%= t("components.feedback.no") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_not_useful") %></span>
@@ -91,8 +83,6 @@
91
83
  controls: "something-is-wrong"
92
84
  },
93
85
  data: {
94
- track_category: "Onsite Feedback",
95
- track_action: "GOV-UK Open Form",
96
86
  ga4_event: ga4_problem_button_event,
97
87
  }) do %>
98
88
  <%= t("components.feedback.something_wrong") %>
@@ -1,5 +1,5 @@
1
1
  <div class="govuk-header__logo gem-c-header__logo">
2
- <a href="<%= logo_link %>" class="govuk-header__link govuk-header__link--homepage" data-module="gem-track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
2
+ <a href="<%= logo_link %>" class="govuk-header__link govuk-header__link--homepage">
3
3
  <svg
4
4
  focusable="false"
5
5
  role="img"
@@ -19,10 +19,6 @@
19
19
  id: "site-search-text",
20
20
  margin_bottom: 0,
21
21
  no_border: true,
22
- data_attributes: {
23
- track_category: "headerClicked",
24
- track_action: "searchSubmitted",
25
- track_label: "none",
26
- },
22
+ disable_corrections: true,
27
23
  } %>
28
24
  </form>
@@ -48,13 +48,6 @@
48
48
  rel: link[:rel],
49
49
  lang: shared_helper.t_locale_check(link[:locale]),
50
50
  data: {
51
- track_category: 'relatedLinkClicked',
52
- track_action: "#{section_index}.#{index} #{related_nav_helper.construct_section_text(section_title, true) || t('components.related_navigation.related_content')}",
53
- track_label: link[:path],
54
- track_options: {
55
- dimension28: links.length.to_s,
56
- dimension29: link[:text]
57
- },
58
51
  ga4_link: ga4_attributes,
59
52
  }
60
53
  )
@@ -50,14 +50,7 @@ module GovukPublishingComponents
50
50
  end
51
51
 
52
52
  def tracking_data(breadcrumbs_length)
53
- data = {
54
- track_category: "breadcrumbClicked",
55
- track_action: index,
56
- track_label: path,
57
- track_options: {
58
- dimension28: breadcrumbs_length.to_s,
59
- dimension29: crumb[:title],
60
- },
53
+ {
61
54
  ga4_link: {
62
55
  event_name: "navigation",
63
56
  type: "breadcrumb",
@@ -65,17 +58,6 @@ module GovukPublishingComponents
65
58
  index_total: breadcrumbs_length.to_s,
66
59
  },
67
60
  }
68
-
69
- is_homepage = crumb[:url] == "/"
70
-
71
- if is_homepage
72
- data[:track_category] = "homeLinkClicked"
73
- data[:track_action] = "homeBreadcrumb"
74
- data[:track_label] = ""
75
- data[:track_options] = "{}"
76
- end
77
-
78
- data
79
61
  end
80
62
 
81
63
  private
@@ -4,11 +4,10 @@ module GovukPublishingComponents
4
4
  include ActionView::Helpers
5
5
  include ActionView::Context
6
6
 
7
- attr_reader :href_data_attributes, :extra_details, :extra_details_no_indent, :heading_text, :metadata, :lang, :image_loading, :youtube_video_id, :image_src, :two_thirds, :large_font_size_mobile
7
+ attr_reader :extra_details, :extra_details_no_indent, :heading_text, :metadata, :lang, :image_loading, :youtube_video_id, :image_src, :two_thirds, :large_font_size_mobile
8
8
 
9
9
  def initialize(local_assigns, brand_helper)
10
10
  @href = local_assigns[:href]
11
- @href_data_attributes = local_assigns[:href_data_attributes]
12
11
  @extra_details = local_assigns[:extra_details] || []
13
12
  @image_src = local_assigns[:image_src]
14
13
  @image_alt = local_assigns[:image_alt] || ""
@@ -51,17 +50,6 @@ module GovukPublishingComponents
51
50
  @two_thirds && @large_font_size_mobile
52
51
  end
53
52
 
54
- def is_tracking?
55
- return true if @href_data_attributes
56
-
57
- if @extra_details
58
- @extra_details.each do |link|
59
- return true if link[:data_attributes]
60
- end
61
- end
62
- false
63
- end
64
-
65
53
  def media
66
54
  return youtube_link if @youtube_video_id
67
55
 
@@ -147,8 +135,6 @@ module GovukPublishingComponents
147
135
  href,
148
136
  {
149
137
  class: "govuk-body govuk-link gem-c-image-card__youtube-thumbnail-container js-youtube-card-embed",
150
- "data-youtube-player-analytics": true,
151
- "data-youtube-player-analytics-category": "EmbeddedYoutube",
152
138
  },
153
139
  ) do
154
140
  youtube_thumbnail
@@ -3,7 +3,6 @@ module GovukPublishingComponents
3
3
  class PublicLayoutHelper
4
4
  BLUE_BAR_BACKGROUND_COLOURS = %w[browse].freeze
5
5
  FOOTER_NAVIGATION_COLUMNS = [2, 1].freeze
6
- FOOTER_TRACK_ACTIONS = %w[topicsLink governmentactivityLink].freeze
7
6
  FOOTER_META = {
8
7
  items: [
9
8
  {
@@ -48,7 +47,7 @@ module GovukPublishingComponents
48
47
 
49
48
  def initialize(local_assigns)
50
49
  @footer_navigation = local_assigns[:footer_navigation] || navigation_link_generation_from_locale(I18n.t("components.layout_footer.navigation_links"))
51
- @footer_meta = local_assigns[:footer_meta] || { items: add_data_attributes_to_links(FOOTER_META[:items], "supportLink") }
50
+ @footer_meta = local_assigns[:footer_meta] || { items: FOOTER_META[:items] }
52
51
  @cookie_banner_data = local_assigns[:cookie_banner_data] || {}
53
52
  end
54
53
 
@@ -57,7 +56,7 @@ module GovukPublishingComponents
57
56
  {
58
57
  title: menu[:title],
59
58
  columns: footer_navigation_columns[i],
60
- items: add_data_attributes_to_links(menu[:menu_contents], footer_track_actions[i]),
59
+ items: menu[:menu_contents],
61
60
  }
62
61
  end
63
62
  end
@@ -66,30 +65,9 @@ module GovukPublishingComponents
66
65
  FOOTER_NAVIGATION_COLUMNS
67
66
  end
68
67
 
69
- def footer_track_actions
70
- FOOTER_TRACK_ACTIONS
71
- end
72
-
73
68
  def blue_bar_background_colours
74
69
  BLUE_BAR_BACKGROUND_COLOURS
75
70
  end
76
-
77
- def generate_data_attribute(link, track_action)
78
- {
79
- track_category: "footerClicked",
80
- track_action:,
81
- track_label: link[:href],
82
- track_options: {
83
- dimension29: link[:text],
84
- },
85
- }
86
- end
87
-
88
- def add_data_attributes_to_links(items, track_action)
89
- items.map do |item|
90
- item.deep_merge({ attributes: { data: generate_data_attribute(item, track_action) } })
91
- end
92
- end
93
71
  end
94
72
  end
95
73
  end
@@ -15,10 +15,6 @@ module GovukPublishingComponents
15
15
  @describedby = get_describedby
16
16
  end
17
17
 
18
- def data_tracking?
19
- @options.any? { |item| item[:data_attributes] && item[:data_attributes][:track_category] && item[:data_attributes][:track_action] }
20
- end
21
-
22
18
  def css_classes
23
19
  classes = %w[govuk-form-group gem-c-select]
24
20
  classes << "govuk-form-group--error" if @error_message
@@ -19,12 +19,7 @@ module GovukPublishingComponents
19
19
  end
20
20
 
21
21
  def data
22
- @data_attributes[:track_label] = base_path
23
- # data-action for tracking should have the format of e.g. "Unsubscribe-button-top", or "Subscribe-button-bottom"
24
- # when button_location is not present data-action will fall back to "Unsubscribe-button"/"Subscribe-button"
25
- @data_attributes[:track_action] = [button_type, "button", button_location].compact.join("-")
26
22
  @data_attributes[:module] = "single-page-notification-button" if js_enhancement
27
- @data_attributes[:track_category] = "Single-page-notification-button"
28
23
  # This attribute is passed through to the personalisation API to ensure when a new button is returned from the API, it has the same button_location
29
24
  @data_attributes[:button_location] = button_location
30
25
  @data_attributes[:button_text_subscribe] = @button_text_subscribe
@@ -14,13 +14,6 @@ module GovukPublishingComponents
14
14
  true if @translations.length > 1
15
15
  end
16
16
 
17
- def tracking_is_present?
18
- @translations.each do |translation|
19
- return true if translation[:data_attributes]
20
- end
21
- false
22
- end
23
-
24
17
  def classes
25
18
  classes = %w[gem-c-translation-nav]
26
19
  classes << inverse_class if @inverse
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "40.0.0".freeze
2
+ VERSION = "41.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 40.0.0
4
+ version: 41.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-15 00:00:00.000000000 Z
11
+ date: 2024-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -432,27 +432,6 @@ files:
432
432
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-video-tracker.js
433
433
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js
434
434
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js
435
- - app/assets/javascripts/govuk_publishing_components/analytics.js
436
- - app/assets/javascripts/govuk_publishing_components/analytics/analytics.js
437
- - app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js
438
- - app/assets/javascripts/govuk_publishing_components/analytics/auto-track-event.js
439
- - app/assets/javascripts/govuk_publishing_components/analytics/cross-domain-tracking.js
440
- - app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js
441
- - app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js
442
- - app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js
443
- - app/assets/javascripts/govuk_publishing_components/analytics/error-tracking.js
444
- - app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js
445
- - app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js
446
- - app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js
447
- - app/assets/javascripts/govuk_publishing_components/analytics/init.js
448
- - app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js
449
- - app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js
450
- - app/assets/javascripts/govuk_publishing_components/analytics/page-content.js
451
- - app/assets/javascripts/govuk_publishing_components/analytics/pii.js
452
- - app/assets/javascripts/govuk_publishing_components/analytics/print-intent.js
453
- - app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js
454
- - app/assets/javascripts/govuk_publishing_components/analytics/track-click.js
455
- - app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js
456
435
  - app/assets/javascripts/govuk_publishing_components/components/accordion.js
457
436
  - app/assets/javascripts/govuk_publishing_components/components/button.js
458
437
  - app/assets/javascripts/govuk_publishing_components/components/character-count.js
@@ -461,7 +440,6 @@ files:
461
440
  - app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js
462
441
  - app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js
463
442
  - app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js
464
- - app/assets/javascripts/govuk_publishing_components/components/details.js
465
443
  - app/assets/javascripts/govuk_publishing_components/components/error-summary.js
466
444
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
467
445
  - app/assets/javascripts/govuk_publishing_components/components/govspeak.js
@@ -1866,7 +1844,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1866
1844
  - !ruby/object:Gem::Version
1867
1845
  version: '0'
1868
1846
  requirements: []
1869
- rubygems_version: 3.5.15
1847
+ rubygems_version: 3.5.16
1870
1848
  signing_key:
1871
1849
  specification_version: 4
1872
1850
  summary: A gem to document components in GOV.UK frontend applications
@@ -1,92 +0,0 @@
1
- ;(function (global) {
2
- 'use strict'
3
-
4
- var GOVUK = global.GOVUK || {}
5
- // For usage and initialisation see:
6
- // https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/analytics.md
7
-
8
- var Analytics = function (config) {
9
- this.pii = new GOVUK.Pii()
10
- this.trackers = []
11
- if (typeof config.universalId !== 'undefined') {
12
- var universalId = config.universalId
13
- delete config.universalId
14
- this.trackers.push(new GOVUK.GoogleAnalyticsUniversalTracker(universalId, config))
15
- }
16
- }
17
-
18
- var PIISafe = function (value) {
19
- this.value = value
20
- }
21
- Analytics.PIISafe = PIISafe
22
-
23
- Analytics.prototype.sendToTrackers = function (method, args) {
24
- // Allows us to stop sending tracking at the moment a user sets their usage cookies to "false" on the cookie settings page.
25
- if (window.GOVUK.stopSendingAnalytics) {
26
- return false
27
- }
28
-
29
- for (var i = 0, l = this.trackers.length; i < l; i++) {
30
- var tracker = this.trackers[i]
31
- var fn = tracker[method]
32
-
33
- if (typeof fn === 'function') {
34
- fn.apply(tracker, args)
35
- }
36
- }
37
- }
38
-
39
- Analytics.load = function () {
40
- GOVUK.GoogleAnalyticsUniversalTracker.load()
41
- }
42
-
43
- Analytics.prototype.defaultPathForTrackPageview = function (location) {
44
- // Get the page path including querystring, but ignoring the anchor
45
- // as per default behaviour of GA (see: https://developers.google.com/analytics/devguides/collection/analyticsjs/pages#overview)
46
- // we ignore the possibility of there being campaign variables in the
47
- // anchor because we wouldn't know how to detect and parse them if they
48
- // were present
49
- // IE can't access window.location.origin, so we have to do this slightly complex thing
50
- var root = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '')
51
- return this.pii.stripPIIFromString(location.href.substring(root.length).split('#')[0])
52
- }
53
-
54
- Analytics.prototype.trackPageview = function (path, title, options) {
55
- arguments[0] = arguments[0] || this.defaultPathForTrackPageview(window.location)
56
- if (arguments.length === 0) { arguments.length = 1 }
57
- return this.sendToTrackers('trackPageview', this.pii.stripPII(arguments))
58
- }
59
-
60
- /*
61
- https://developers.google.com/analytics/devguides/collection/analyticsjs/events
62
- options.label – Useful for categorizing events (eg nav buttons)
63
- options.value – Values must be non-negative. Useful to pass counts
64
- options.nonInteraction – Prevent event from impacting bounce rate
65
- */
66
- Analytics.prototype.trackEvent = function (category, action, options) {
67
- return this.sendToTrackers('trackEvent', this.pii.stripPII(arguments))
68
- }
69
-
70
- Analytics.prototype.trackShare = function (network, options) {
71
- return this.sendToTrackers('trackSocial', this.pii.stripPII([network, 'share', global.location.pathname, options]))
72
- }
73
-
74
- /*
75
- The custom dimension index must be configured within the
76
- Universal Analytics profile
77
- */
78
- Analytics.prototype.setDimension = function (index, value) {
79
- return this.sendToTrackers('setDimension', this.pii.stripPII(arguments))
80
- }
81
-
82
- /*
83
- Add a beacon to track a page in another GA account on another domain.
84
- */
85
- Analytics.prototype.addLinkedTrackerDomain = function (trackerId, name, domain) {
86
- return this.sendToTrackers('addLinkedTrackerDomain', arguments)
87
- }
88
-
89
- GOVUK.Analytics = Analytics
90
-
91
- global.GOVUK = GOVUK
92
- })(window)