Skip to content

Commit

Permalink
Restore missing GA4 attributes
Browse files Browse the repository at this point in the history
- tracking for the option select component in finders depends upon some JS to set the right attributes
- this wasn't working properly owing to the migration of the component, this fixes that
  • Loading branch information
andysellick committed Sep 21, 2023
1 parent ae3a880 commit c7c3a96
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions app/views/finders/_option_select_facet.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<% cache_if option_select_facet.cacheable?, option_select_facet.cache_key do %>
<%= render partial: 'govuk_publishing_components/components/option_select', locals: {
:key => option_select_facet.key,
:title => option_select_facet.name,
:aria_controls_id => "js-search-results-info",
:options_container_id => option_select_facet.key,
:options => option_select_facet.options("js-search-results-info", option_select_facet.key),
:closed_on_load => option_select_facet.closed_on_load?(option_select_facet_counter),
:closed_on_load_mobile => option_select_facet.closed_on_load_mobile?,
:show_filter => option_select_facet.show_option_select_filter,
:large => option_select_facet.large?
}
%>
<div data-ga4-change-category="update-filter checkbox" data-ga4-filter-parent data-ga4-section="<%= option_select_facet.name %>">
<%= render partial: 'govuk_publishing_components/components/option_select', locals: {
:key => option_select_facet.key,
:title => option_select_facet.name,
:aria_controls_id => "js-search-results-info",
:options_container_id => option_select_facet.key,
:options => option_select_facet.options("js-search-results-info", option_select_facet.key),
:closed_on_load => option_select_facet.closed_on_load?(option_select_facet_counter),
:closed_on_load_mobile => option_select_facet.closed_on_load_mobile?,
:show_filter => option_select_facet.show_option_select_filter,
:large => option_select_facet.large?
} %>
</div>
<% end %>

0 comments on commit c7c3a96

Please sign in to comment.