Skip to content

Commit

Permalink
Fix GA4 indexes on option select search facets
Browse files Browse the repository at this point in the history
  • Loading branch information
andysellick committed Feb 27, 2024
1 parent 62d74ee commit 5b29b0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/option_select_facet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def cacheable?
unselected? || selected_values.one?
end

def cache_key
Digest::SHA256.hexdigest({ name:, selected: selected_values, allowed: allowed_values }.to_json)
def cache_key(index_section = nil, index_section_count = nil)
Digest::SHA256.hexdigest({ name:, ga4_section:, index_section:, index_section_count:, selected: selected_values, allowed: allowed_values }.to_json)
end

def query_params
Expand Down
2 changes: 1 addition & 1 deletion app/views/finders/_option_select_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
index_section = index + 1
index_section_count = count
%>
<% cache_if option_select_facet.cacheable?, option_select_facet.cache_key do %>
<% cache_if option_select_facet.cacheable?, option_select_facet.cache_key(index_section, index_section_count) do %>
<%= render partial: 'govuk_publishing_components/components/option_select', locals: {
:key => option_select_facet.key,
:title => option_select_facet.name,
Expand Down

0 comments on commit 5b29b0c

Please sign in to comment.