Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GA4 indexes on option select search facets #3294

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

andysellick
Copy link
Contributor

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Fix GA4 indexes on search facets when expanded or collapsed on pages like: https://www.gov.uk/search/guidance-and-regulation

  • the indexes were coming out wrong for the option select facets, increased by 1, but okay for any preceding or following facets
  • looks to be a problem where the values for index_section and index_section_count are cached inside the facet and are therefore sometimes wrong
  • need to pass them to the cache_key to let it invalidate the cache if the numbers change

Thanks to @sihugh for invaluable cache advice 👍

Why

The indexes were being generated as e.g.

  1. (topic facet) index_section: 1, index_section_count: 4
  2. (option select facet) index_section: 3, index_section_count: 5 (wrong)
  3. (option select facet) index_section: 4, index_section_count: 5 (wrong)
  4. (date facet) index_section: 4, index_section_count: 4

Visual changes

None.

Trello card: https://trello.com/c/l5YsyfsN/794-fix-incorrect-index-values-on-guidance-and-regulation-finder-filters

@govuk-ci govuk-ci temporarily deployed to finder-frontend-pr-3294 February 27, 2024 09:50 Inactive
@govuk-ci govuk-ci temporarily deployed to finder-frontend-pr-3294 February 27, 2024 09:57 Inactive
@sihugh
Copy link
Contributor

sihugh commented Feb 27, 2024

Looks good to me 👍

@andysellick andysellick merged commit 51e9ce0 into main Feb 27, 2024
14 checks passed
@andysellick andysellick deleted the fix-facet-indexes-again branch February 27, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants