govuk_publishing_components 40.1.0 → 41.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) 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/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +192 -171
  16. data/app/assets/stylesheets/component_guide/application.scss +10 -11
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +2 -3
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +3 -3
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +47 -22
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +3 -3
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +1 -3
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -1
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +19 -19
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -10
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +3 -3
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -2
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +8 -8
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +16 -10
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +2 -2
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +2 -2
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +33 -35
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +3 -3
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +1 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +1 -1
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +13 -3
  41. data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
  42. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +6 -6
  43. data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +2 -3
  44. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +4 -3
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -3
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +3 -4
  47. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +3 -3
  48. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +10 -10
  49. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
  50. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
  51. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +3 -3
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
  53. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +5 -4
  54. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -1
  55. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -2
  56. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +2 -2
  57. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -1
  58. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  59. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +5 -5
  60. data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -8
  61. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  62. data/app/views/govuk_publishing_components/components/_cards.html.erb +6 -11
  63. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +2 -15
  64. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -19
  65. data/app/views/govuk_publishing_components/components/_details.html.erb +9 -11
  66. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -5
  67. data/app/views/govuk_publishing_components/components/_intervention.html.erb +4 -4
  68. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -21
  69. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -26
  70. data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -5
  71. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +2 -7
  72. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +0 -10
  73. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +1 -3
  74. data/app/views/govuk_publishing_components/components/_search.html.erb +0 -1
  75. data/app/views/govuk_publishing_components/components/_select.html.erb +1 -2
  76. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -10
  77. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +0 -1
  78. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +1 -1
  79. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -24
  80. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -14
  81. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -4
  82. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +0 -1
  83. data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +1 -7
  84. data/app/views/govuk_publishing_components/components/docs/accordion.yml +1 -60
  85. data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -6
  86. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +0 -1
  87. data/app/views/govuk_publishing_components/components/docs/button.yml +1 -1
  88. data/app/views/govuk_publishing_components/components/docs/cards.yml +41 -20
  89. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +0 -33
  90. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
  91. data/app/views/govuk_publishing_components/components/docs/details.yml +0 -15
  92. data/app/views/govuk_publishing_components/components/docs/document_list.yml +11 -18
  93. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -1
  94. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +0 -11
  95. data/app/views/govuk_publishing_components/components/docs/image_card.yml +0 -31
  96. data/app/views/govuk_publishing_components/components/docs/intervention.yml +0 -26
  97. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +2 -2
  98. data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +0 -2
  99. data/app/views/govuk_publishing_components/components/docs/option_select.yml +4 -16
  100. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +0 -15
  101. data/app/views/govuk_publishing_components/components/docs/print_link.yml +2 -9
  102. data/app/views/govuk_publishing_components/components/docs/select.yml +0 -36
  103. data/app/views/govuk_publishing_components/components/docs/share_links.yml +2 -4
  104. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +2 -25
  105. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +0 -23
  106. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +0 -10
  107. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +3 -15
  108. data/app/views/govuk_publishing_components/components/docs/table.yml +1 -1
  109. data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
  110. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +3 -27
  111. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +1 -5
  112. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +0 -2
  113. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +0 -10
  114. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  115. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +0 -5
  116. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +0 -7
  117. data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -19
  118. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +1 -15
  119. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +2 -24
  120. data/lib/govuk_publishing_components/presenters/select_helper.rb +0 -4
  121. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +0 -5
  122. data/lib/govuk_publishing_components/presenters/translation_nav_helper.rb +0 -7
  123. data/lib/govuk_publishing_components/version.rb +1 -1
  124. metadata +4 -26
  125. data/app/assets/javascripts/govuk_publishing_components/analytics/analytics.js +0 -92
  126. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +0 -221
  127. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-track-event.js +0 -30
  128. data/app/assets/javascripts/govuk_publishing_components/analytics/cross-domain-tracking.js +0 -55
  129. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +0 -133
  130. data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +0 -46
  131. data/app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js +0 -101
  132. data/app/assets/javascripts/govuk_publishing_components/analytics/error-tracking.js +0 -51
  133. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +0 -88
  134. data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +0 -68
  135. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +0 -220
  136. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +0 -60
  137. data/app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js +0 -135
  138. data/app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js +0 -43
  139. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +0 -160
  140. data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +0 -115
  141. data/app/assets/javascripts/govuk_publishing_components/analytics/print-intent.js +0 -39
  142. data/app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js +0 -132
  143. data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +0 -75
  144. data/app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js +0 -56
  145. data/app/assets/javascripts/govuk_publishing_components/analytics.js +0 -23
  146. data/app/assets/javascripts/govuk_publishing_components/components/details.js +0 -48
@@ -13,7 +13,6 @@
13
13
  ga4_link_data_attributes[:url] = spnb_helper.form_action if ga4_link_data_attributes
14
14
 
15
15
  component_helper.add_class(wrapper_classes.join(" "))
16
- component_helper.add_data_attribute({ module: "gem-track-click" })
17
16
  component_helper.add_data_attribute({ module: ga4_data_attributes[:module] }) if ga4_data_attributes
18
17
  %>
19
18
  <% button_text = capture do %>
@@ -10,7 +10,7 @@
10
10
  remember_last_step ||= false
11
11
  step_nav_url ||= false
12
12
  highlight_step ||= false
13
- tracking_id ||= false
13
+ tracking_id ||= false # used to remember open steps, see docs
14
14
  step_nav_content_id ||= tracking_id
15
15
 
16
16
  step_count = 0
@@ -11,20 +11,7 @@
11
11
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
12
12
 
13
13
  data = {}
14
- data[:module] = "gem-track-click"
15
- data[:module] << " ga4-link-tracker" unless disable_ga4
16
-
17
- tracking_id ||= false
18
- tracking_category ||= "stepNavHeaderClicked"
19
- tracking_action ||= "top"
20
- tracking_label ||= path
21
- tracking_dimension_enabled = tracking_dimension_enabled != false
22
- tracking_dimension ||= title
23
- tracking_dimension_index ||= 29
24
-
25
- if tracking_id
26
- tracking_options ||= ({ dimension96: tracking_id }).to_json
27
- end
14
+ data[:module] = "ga4-link-tracker" unless disable_ga4
28
15
 
29
16
  unless disable_ga4
30
17
  ga4_data = {
@@ -49,19 +36,9 @@
49
36
  <% if path %>
50
37
  <a href="<%= path %>"
51
38
  class="gem-c-step-nav-header__title govuk-link"
52
- data-track-category="<%= tracking_category %>"
53
- data-track-action="<%= tracking_action %>"
54
- data-track-label="<%= tracking_label %>"
55
39
  <% unless disable_ga4 %>
56
40
  data-ga4-link='<%= ga4_data %>'
57
41
  <% end %>
58
- <% if tracking_dimension_enabled %>
59
- data-track-dimension="<%= tracking_dimension %>"
60
- data-track-dimension-index="<%= tracking_dimension_index %>"
61
- <% end %>
62
- <% if tracking_id %>
63
- data-track-options='<%= tracking_options %>'
64
- <% end %>
65
42
  >
66
43
  <%= title %>
67
44
  </a>
@@ -7,8 +7,7 @@
7
7
  classes = %w(gem-c-step-nav-related)
8
8
  classes << "gem-c-step-nav-related--singular" if links.length == 1
9
9
  data = {}
10
- data[:module] = "gem-track-click"
11
- data[:module] << " ga4-link-tracker" unless disable_ga4
10
+ data[:module] = "ga4-link-tracker" unless disable_ga4
12
11
  %>
13
12
  <% if links.any? %>
14
13
  <%= tag.div(class: classes, data: data) do %>
@@ -17,12 +16,6 @@
17
16
  <% if links.length == 1 && !always_display_as_list %>
18
17
  <a href="<%= links[0][:href] %>"
19
18
  class="govuk-link"
20
- data-track-category="stepNavPartOfClicked"
21
- data-track-action="<%= pretitle %>"
22
- data-track-label="<%= links[0][:href] %>"
23
- data-track-dimension="<%= links[0][:text] %>"
24
- data-track-dimension-index="29"
25
- data-track-options='{"dimension96" : "<%= links[0][:tracking_id] %>" }'
26
19
  <% unless disable_ga4
27
20
  ga4_attributes = {
28
21
  event_name: "navigation",
@@ -45,12 +38,6 @@
45
38
  <li class="gem-c-step-nav-related__link-item">
46
39
  <a href="<%= link[:href] %>"
47
40
  class="govuk-link"
48
- data-track-category="stepNavPartOfClicked"
49
- data-track-action="<%= pretitle %>"
50
- data-track-label="<%= link[:href] %>"
51
- data-track-dimension="<%= link[:text] %>"
52
- data-track-dimension-index="29"
53
- data-track-options='{"dimension96" : "<%= link[:tracking_id] %>" }'
54
41
  <% unless disable_ga4
55
42
  ga4_attributes = {
56
43
  event_name: "navigation",
@@ -27,10 +27,7 @@
27
27
  <% unless hide_heading %>
28
28
  <h2 class="gem-c-subscription-links__hidden-header visuallyhidden"><%= t("components.subscription_links.subscriptions") %></h2>
29
29
  <% end %>
30
- <ul
31
- class="gem-c-subscription-links__list<%= ' gem-c-subscription-links__list--small' if local_assigns[:small_form] == true %>"
32
- <%= "data-module=gem-track-click" if sl_helper.tracking_is_present? %>
33
- >
30
+ <ul class="gem-c-subscription-links__list<%= ' gem-c-subscription-links__list--small' if local_assigns[:small_form] == true %>">
34
31
  <% if sl_helper.email_signup_link.present? %>
35
32
  <li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>" >
36
33
  <% email_link_text = capture do %>
@@ -9,7 +9,6 @@
9
9
  <nav role="navigation"
10
10
  class="gem-c-translation-nav govuk-!-display-none-print <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
11
11
  aria-label="<%= t("common.translations") %>"
12
- <%= "data-module=\"gem-track-click\"" if translation_helper.tracking_is_present? %>
13
12
  >
14
13
  <ul class="gem-c-translation-nav__list">
15
14
  <% translation_helper.translations.each.with_index do |translation, i| %>
@@ -2,8 +2,7 @@
2
2
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
3
  title = t("components.related_navigation.ukraine.title")
4
4
  lang = shared_helper.t_locale("components.related_navigation.ukraine.title")
5
- data_module = "gem-track-click"
6
- data_module << " ga4-link-tracker" unless disable_ga4
5
+ data_module = "ga4-link-tracker" unless disable_ga4
7
6
  %>
8
7
  <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--ukraine", data: { module: data_module } do %>
9
8
  <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
@@ -26,11 +25,6 @@
26
25
  link[:href],
27
26
  class: "govuk-link",
28
27
  data: {
29
- "track-category": "relatedLinkClicked",
30
- "track-action": "1.0 Invasion of Ukraine",
31
- "track-label": link[:href],
32
- "track-dimension": link[:label],
33
- "track-dimension-index": "29",
34
28
  ga4_link: ga4_attributes,
35
29
  },
36
30
  lang: lang %>
@@ -199,16 +199,10 @@ examples:
199
199
  description: |
200
200
  Adds custom data attributes to each section of the accordion. Accepts a hash, so multiple attributes can be added.
201
201
 
202
- The `data_attributes` option applies attributes to the outermost element in the accordion. Each item can also have a `data_attributes` hash, which are placed on the `button` that triggers the opening and closing - useful for differentiating between each section of the accordion.
203
-
204
- Data attributes can be added to the 'Show/hide all' link using the `data_attributes_show_all` option, primarily where custom tracking is required. These attributes are read from the accordion markup and then added to the link by JavaScript (which is how the link is created). Currently, this is only used for tracking with Universal Analytics.
205
-
206
- If `track_options` within `data_attributes_show_all` is set, then it is possible to pass a custom dimension when 'Show/Hide all' is clicked.
202
+ The `data_attributes` option applies attributes to the outermost element in the accordion. Individual items can also have their own `data_attributes` hash, which are placed on the `button` that triggers the opening and closing of that section - useful for differentiating between each section of the accordion.
207
203
  data:
208
204
  data_attributes:
209
205
  custom_data_attr: custom-data-attr-accordion
210
- data_attributes_show_all:
211
- tracking-options: "{ 'dimension114': 1 }"
212
206
  items:
213
207
  - heading:
214
208
  text: Writing well for the web
@@ -234,20 +228,6 @@ examples:
234
228
  html: <p class="govuk-body">This is the content for How people read.</p>
235
229
  data_attributes:
236
230
  custom_data_attr: custom-data-attr-accordion-item-4
237
- with_custom_data_module:
238
- description: The component includes its own `data-module` but others can be passed in addition if required, for example to apply tracking to an element. This will be included along with the components own `data-module`.
239
- data:
240
- data_attributes:
241
- module: gem-track-click
242
- items:
243
- - heading:
244
- text: Writing well for the web
245
- content:
246
- html: <p class="govuk-body">This is the content for Writing well for the web.</p>
247
- - heading:
248
- text: Writing well for specialists
249
- content:
250
- html: <p class="govuk-body">This is the content for Writing well for specialists.</p>
251
231
  different_heading_level:
252
232
  description: This will alter the level of the heading, not the appearance of the heading.
253
233
  data:
@@ -339,42 +319,3 @@ examples:
339
319
  text: How people read
340
320
  content:
341
321
  html: <p class="govuk-body">This is the content for How people read.</p>
342
- with_track_show_all_clicks:
343
- description: |
344
- To switch on Google Analytics for the "Show all sections" button on click, pass `track_show_all_clicks: true` the values passed on open will be
345
- `Event Action: accordionOpened` `Event Category: pageElementInteraction` `Event Label: Show all sections`
346
- data:
347
- track_show_all_clicks: true
348
- items:
349
- - heading:
350
- text: Writing well for the web
351
- id: writing-well-for-the-web-2
352
- content:
353
- html: <p class="govuk-body">This is content for accordion 1 of 2</p>
354
- - heading:
355
- text: Writing well for specialists
356
- content:
357
- html: <p class="govuk-body">This is content for accordion 2 of 2</p>
358
- with_track_sections:
359
- description: |
360
- To switch on Google Analytics for each section, on click, pass `track_sections: true` the values passed on open will be
361
- `Event Action: accordionOpened` / `accordionClosed` `Event Category: pageElementInteraction` and the `Event Label` being the heading text.
362
-
363
- If `track_options` in an item is set, then it is possible to pass a custom dimension when the section is clicked.
364
-
365
- (`track_show_all_clicks: true` can be added to track the "Show all sections" button as well, if required)
366
- data:
367
- track_sections: true
368
- items:
369
- - heading:
370
- text: Writing well for the web
371
- id: writing-well-for-the-web-3
372
- content:
373
- html: <p class="govuk-body">This is content for accordion 1 of 2</p><p class="govuk-body">This content contains a <a href="#anchor-nav-test" class="govuk-link">link</a></p>
374
- data_attributes:
375
- track_options:
376
- dimension114: 1
377
- - heading:
378
- text: Writing well for specialists
379
- content:
380
- html: <p class="govuk-body" id="anchor-nav-test">This is content for accordion 2 of 2</p>
@@ -37,17 +37,13 @@ examples:
37
37
  description: |
38
38
  If a `href` attribute is present, `data_attributes` will apply to the `span` containing the number value (see below).
39
39
 
40
- 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).
40
+ 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).
41
41
  data:
42
42
  number: 23
43
43
  label: Ministerial departments
44
44
  href: "/government/organisations#ministerial_departments"
45
45
  data_attributes:
46
- track-category: homepageClicked
47
- track-action: departmentsLink
48
- track-label: "/government/organisations#ministerial_departments"
49
- track-dimension: 23 Ministerial departments
50
- track-dimension-index: 29
46
+ department-count: true
51
47
  with_data_attributes_but_no_link:
52
48
  data:
53
49
  number: 23
@@ -2,7 +2,6 @@ name: "Breadcrumbs"
2
2
  description: "Navigational breadcrumbs, showing page hierarchy"
3
3
  body: |
4
4
  Accepts an array of breadcrumb objects. Each crumb must have a title and a URL.
5
- Links are tracked, but in Universal Analytics, links to the homepage (any link with a url of `/`) will be tracked separately as `homeLinkClicked`.
6
5
 
7
6
  We recommend that if using the breadcrumbs for navigation purposes, you set `collapse_on_mobile` to `true` to make things more readable for mobile users. However, you can specify `collapse_on_mobile:``false` or remove the flag completely to stop this behaviour.
8
7
  shared_accessibility_criteria:
@@ -97,7 +97,7 @@ examples:
97
97
  start: true
98
98
  href: '#'
99
99
  with_data_attributes:
100
- description: Data attributes can 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).
100
+ description: Data attributes can 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).
101
101
  data:
102
102
  text: Track this!
103
103
  margin_bottom: true
@@ -1,13 +1,11 @@
1
- name: Cards (experimental)
1
+ name: Cards
2
2
  description: A grid of cards that have a link and a description
3
3
  body: |
4
- The component renders the cards as an unordered list element and visually presents it as a grid. It doesn't use the [GOV.UK Design System grid](https://design-system.service.gov.uk/styles/layout/#grid-system) but sets its own so that it can separately target desktop, tablet and mobile columns.
4
+ The component renders the cards as an unordered list element and visually presents it using CSS grid to display the cards in either a one (default), two or three column layout. It doesn't use the [GOV.UK Design System grid](https://design-system.service.gov.uk/styles/layout/#grid-system) but sets its own so that it can separately target desktop, tablet and mobile columns.
5
5
 
6
- You can display the grid in three or two columns on desktop. Browsers that don't support CSS grid always display one column.
6
+ Browsers that don't support CSS grid always display one column.
7
7
 
8
8
  You must set a `href` for all the links.
9
-
10
- This component is currently experimental. If you are using it, please feed back any research findings to the GOV.UK Explore team.
11
9
  accessibility_criteria: |
12
10
  The component must:
13
11
 
@@ -71,9 +69,42 @@ examples:
71
69
  path: http://www.gov.uk
72
70
  description: Owning or renting and council services
73
71
  two_column_layout:
74
- description: Override default three column layout on desktop by passing through `two_column_layout` parameter (defaults to `false`).
72
+ description: Override default single column layout on desktop by setting the `columns` parameter to `2`.
73
+ data:
74
+ columns: 2
75
+ items:
76
+ - link:
77
+ text: Benefits
78
+ path: http://www.gov.uk
79
+ description: Includes eligibility, appeals, tax credits and Universal Credit
80
+ - link:
81
+ text: Births, deaths, marriages and&nbsp;care
82
+ path: http://www.gov.uk
83
+ description: Parenting, civil partnerships, divorce and Lasting Power of Attorney
84
+ - link:
85
+ text: Business and self-employed
86
+ path: http://www.gov.uk
87
+ description: Tools and guidance for businesses
88
+ - link:
89
+ text: Childcare and parenting
90
+ path: http://www.gov.uk
91
+ description: Includes giving birth, fostering, adopting, benefits for children, childcare and schools
92
+ - link:
93
+ text: Citizenship and living in the&nbsp;UK
94
+ path: http://www.gov.uk
95
+ description: Voting, community participation, life in the UK, international projects
96
+ - link:
97
+ text: Crime, justice and the&nbsp;law
98
+ path: http://www.gov.uk
99
+ description: Legal processes, courts and the police
100
+ - link:
101
+ text: Disabled people
102
+ path: http://www.gov.uk
103
+ description: Includes carers, your rights, benefits and the Equality Act
104
+ three_column_layout:
105
+ description: Override default single column layout on desktop by setting the `columns` parameter to `3`.
75
106
  data:
76
- two_column_layout: true
107
+ columns: 3
77
108
  items:
78
109
  - link:
79
110
  text: Benefits
@@ -121,28 +152,18 @@ examples:
121
152
  description: |
122
153
  Data attributes can be passed to individual links within the component as shown.
123
154
 
124
- 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).
155
+ 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).
125
156
  data:
126
157
  items:
127
158
  - link:
128
159
  text: Benefits
129
160
  path: http://www.gov.uk
130
161
  data_attributes:
131
- track_category: homepageClicked
132
- track_action: track-action
133
- track_label: track-label
134
- track_dimension: track-dimension
135
- track_dimension_index: 29
136
- track_value: 9
162
+ an_attribute: some_value
137
163
  description: Includes eligibility, appeals, tax credits and Universal Credit
138
164
  - link:
139
165
  text: Births, deaths, marriages and&nbsp;care
140
166
  path: http://www.gov.uk
141
167
  data_attributes:
142
- track_category: homepageClicked
143
- track_action: track-action
144
- track_label: track-label
145
- track_dimension: track-dimension
146
- track_dimension_index: 29
147
- track_value: 9
168
+ an_attribute: some_value
148
169
  description: Parenting, civil partnerships, divorce and Lasting Power of Attorney
@@ -200,39 +200,6 @@ examples:
200
200
  value: green
201
201
  - label: Blue
202
202
  value: blue
203
- checkboxes_with_data_attributes:
204
- description: Data attributes for tracking can be applied as shown. Custom JavaScript in the component will fire identical tracking events on check and uncheck. See below to send different events on uncheck.
205
- data:
206
- name: With tracking
207
- items:
208
- - label: Tracked
209
- value: tracked
210
- data_attributes: {
211
- track_category: checkboxClicked,
212
- track_label: /news-and-communications,
213
- track_action: news,
214
- track_options: {
215
- dimension28: 2,
216
- dimension29: Tracked
217
- }
218
- }
219
- checkboxes_with_data_attributes_and_custom_uncheck_event_category:
220
- description: Data attributes for tracking can be applied as shown. Custom JavaScript in the component will fire different tracking events on check and uncheck.
221
- data:
222
- name: With tracking and a custom uncheck category
223
- items:
224
- - label: Tracked
225
- value: tracked
226
- data_attributes: {
227
- track_category: checkboxClicked,
228
- untrack_category: checkboxUnchecked,
229
- track_label: /news-and-communications,
230
- track_action: news,
231
- track_options: {
232
- dimension28: 2,
233
- dimension29: Tracked
234
- }
235
- }
236
203
  with_aria_controls_attributes:
237
204
  description: Aria controls attributes are applied to the checkboxes only if JavaScript is enabled.
238
205
  data:
@@ -41,11 +41,11 @@ examples:
41
41
  "yes":
42
42
  text: "Yes"
43
43
  data_attributes:
44
- track-category: cookieBanner
44
+ an_attribute: some_value1
45
45
  "no":
46
46
  text: "No"
47
47
  data_attributes:
48
- "track-category": "cookieBanner"
48
+ an_attribute: some_value2
49
49
  cookie_preferences:
50
50
  text: How we use cookies
51
51
  href: "/cookies"
@@ -21,21 +21,6 @@ examples:
21
21
  title: Help with nationality
22
22
  block: |
23
23
  We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
24
- with_data_attributes:
25
- description: |
26
- Data attributes can be applied to the summary element of the component.
27
-
28
- This can be used for tracking as shown. Custom JavaScript in the component fires tracking events when the details element is opened and closed. By default, `track-label` is set to the status (`open` or `closed`) unless a `track_label` is passed into the component.
29
- data:
30
- title: Help with nationality
31
- data_attributes:
32
- track_category: "checker-qa"
33
- track_action: "business-question"
34
- track_label: "custom label here"
35
- track_options:
36
- dimension20: "custom dimension"
37
- block: |
38
- We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
39
24
  with_aria_attributes:
40
25
  description: |
41
26
  Aria attributes can be applied to the summary element of the component.
@@ -75,19 +75,17 @@ examples:
75
75
  public_updated_at: 2016-09-05 16:48:27
76
76
  document_type: 'Statutory guidance'
77
77
  with_data_attributes_on_links:
78
- description: Note that the component does not include built in Universal Analytics 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).
79
78
  data:
80
79
  items:
81
80
  - link:
82
81
  text: 'School behaviour and attendance: parental responsibility measures'
83
82
  path: '/government/publications/parental-responsibility-measures-for-behaviour-and-attendance'
84
83
  data_attributes:
85
- track_category: 'navDocumentCollectionLinkClicked'
86
- track_action: 1.1
87
- track_label: '/government/publications/parental-responsibility-measures-for-behaviour-and-attendance'
88
- track_options:
89
- dimension28: 2
90
- dimension29: 'School behaviour and attendance: parental responsibility measures'
84
+ a_thing: 'hello'
85
+ another_thing: 'there'
86
+ more_things:
87
+ look: 'over'
88
+ there: 'now'
91
89
  metadata:
92
90
  public_updated_at: 2017-01-05 14:50:33
93
91
  document_type: 'Statutory guidance'
@@ -95,12 +93,11 @@ examples:
95
93
  text: 'School exclusion'
96
94
  path: '/government/publications/school-exclusion'
97
95
  data_attributes:
98
- track_category: 'navDocumentCollectionLinkClicked'
99
- track_action: 1.2
100
- track_label: '/government/publications/school-exclusion'
101
- track_options:
102
- dimension28: 2
103
- dimension29: 'School exclusion'
96
+ a_thing: 'hello'
97
+ another_thing: 'there'
98
+ more_things:
99
+ look: 'over'
100
+ there: 'now'
104
101
  metadata:
105
102
  public_updated_at: 2017-07-19 15:01:48
106
103
  document_type: 'Statutory guidance'
@@ -306,11 +303,7 @@ examples:
306
303
  path: '/universal-credit/eligibility'
307
304
  description: 'You may be able to get Universal Credit if: you’re on a low income or out...'
308
305
  data_attributes:
309
- track_category: 'resultPart'
310
- track_action: 2
311
- track_label: 'Result part 2'
312
- track_options:
313
- dimension82: 2
306
+ an_attribute: some_value
314
307
  - link:
315
308
  text: 'Criteria'
316
309
  description: 'no url provided, just text'
@@ -25,7 +25,7 @@ examples:
25
25
  description: |
26
26
  The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
27
27
 
28
- 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).
28
+ 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).
29
29
  data:
30
30
  message: Message to alert the user to a unsuccessful action goes here
31
31
  description: A further description
@@ -504,17 +504,6 @@ examples:
504
504
  block: |
505
505
  <p>This content has a YouTube livestream link, converted to an accessible embedded player by component JavaScript.</p>
506
506
  <p><a href="https://www.youtube.com/embed/live_stream?channel=UCoMdktPbSTixAyNGwb-UYkQ">Livestream video</a></p>
507
- with_youtube_analytics:
508
- data:
509
- block: |
510
- <p>This content has a YouTube link with analytics, converted to an accessible embedded player by component JavaScript.</p>
511
- <p>
512
- <a href="https://www.youtube.com/watch?v=ucjmWjJ25Ho"
513
- data-youtube-player-analytics="true"
514
- data-youtube-player-analytics-category="demo-for-components">
515
- Youtube video with tracking
516
- </a>
517
- </p>
518
507
  with_youtube_embed_disabled:
519
508
  data:
520
509
  disable_youtube_expansions: true
@@ -246,37 +246,6 @@ examples:
246
246
  <div class="govuk-!-width-full">
247
247
  <%= component %>
248
248
  </div>
249
- with_data_attributes:
250
- description: Data attributes can 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).
251
- data:
252
- href: "/i-am-not-a-valid-link"
253
- href_data_attributes: {
254
- track_category: 'href_category',
255
- track_action: 1.1,
256
- track_label: 'href_label',
257
- track_options: {
258
- dimension28: 1,
259
- dimension29: 'dimension29Href'
260
- }
261
- }
262
- image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
263
- image_alt: "some meaningful alt text please"
264
- heading_text: "A link with tracking"
265
- extra_details: [
266
- {
267
- text: "Another link with tracking",
268
- href: "/1",
269
- data_attributes: {
270
- track_category: 'extra_category',
271
- track_action: 2.1,
272
- track_label: 'extra_label',
273
- track_options: {
274
- dimension28: 1,
275
- dimension29: 'dimension29Extra'
276
- }
277
- }
278
- }
279
- ]
280
249
  with_ga4_tracking:
281
250
  description: The component does not include an option for GA4 tracking, but data attributes to enable the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) can be passed as shown.
282
251
  data:
@@ -63,32 +63,6 @@ examples:
63
63
  suggestion_link_url: www.google.com/permit
64
64
  new_tab: true
65
65
 
66
- with_data_attributes:
67
- description: |
68
- This example shows the use of `suggestion_data_attributes`,
69
- `dismiss_data_attributes` for click tracking on the dismiss section <p> tag, and `dismiss_link_data_attributes` for adding attributes to the dismiss link <a> tag.
70
-
71
- 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).
72
- data:
73
- suggestion_text: Based on your browsing you might be interested in
74
- suggestion_link_text: "Travel abroad: step by step"
75
- suggestion_link_url: /travel-abroad
76
- suggestion_data_attributes:
77
- track-category: interventionBanner
78
- track-action: interventionClicked
79
- track-dimension: "Travel abroad: step by step"
80
- track-dimension-index: 29
81
- track-label: clicked suggestion
82
- dismiss_text: Hide this suggestion
83
- name: another-campaign-name
84
- dismiss_data_attributes:
85
- track-category: interventionBanner
86
- track-action: interventionDismissed
87
- track-dimension: Hide this suggestion
88
- track-dimension-index: 29
89
- track-label: hide the intervention
90
- dismiss_link_data_attributes:
91
- track-category: example
92
66
  without_ga4_tracking:
93
67
  description: |
94
68
  Disables GA4 tracking on the banner. Tracking is enabled by default. This includes link tracking on the component itself, event tracking on the 'Hide' link, and allows pageviews to record the presence of the banner on page load.
@@ -115,11 +115,11 @@ examples:
115
115
  yes:
116
116
  text: Yes
117
117
  data_attributes:
118
- track_category: cookieBanner
118
+ an_attribute: some_value1
119
119
  no:
120
120
  text: No
121
121
  data_attributes:
122
- track-category: cookieBanner
122
+ an_attribute: some_value2
123
123
  cookie_preferences:
124
124
  text: How GOV.UK accounts use cookies
125
125
  href: https://www.gov.uk/government/publications/govuk-accounts-trial-full-privacy-notice-and-accessibility-statement
@@ -5,8 +5,6 @@ body: |
5
5
  the correct analytics identifier metadata tags.
6
6
 
7
7
  These are additionally used by the <a href="https://github.com/alphagov/govuk-browser-extension">GOV.UK browser extension</a> to provide details about a given page.
8
-
9
- The code which reads the meta tags can be found <a href="https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js">in custom-dimensions.js</a>.
10
8
  accessibility_criteria: |
11
9
  The analytics meta tags component should not be visible to any users.
12
10
  display_html: true