Skip to content

[5.x] Retain UTM fields in listing pages#1246

Merged
royduin merged 5 commits into
masterfrom
feature/utm-fields
May 1, 2026
Merged

[5.x] Retain UTM fields in listing pages#1246
royduin merged 5 commits into
masterfrom
feature/utm-fields

Conversation

@Jade-GG
Copy link
Copy Markdown
Collaborator

@Jade-GG Jade-GG commented Apr 1, 2026

ref: HDB-1060

Right now we end up stripping away every param from the route that's not a valid filter. However, we may want to retain the utm fields for tracking reasons.

Right now I've specifically focused on those fields, as it's harder to figure out exactly which fields are not part of the filters set. Also note that this will cause any attributes starting with utm_ to no longer work with the routing.

@indykoning
Copy link
Copy Markdown
Member

Is there any reason we're stripping any url params to begin with? Or a mere side effect from the stateToRoute function?
Wouldn't it be simpler to merge all current url params with the information in stateToRoute?

This way we never remove params not referenced by the uiState

@Jade-GG
Copy link
Copy Markdown
Collaborator Author

Jade-GG commented Apr 3, 2026

Is there any reason we're stripping any url params to begin with? Or a mere side effect from the stateToRoute function?

It is a side effect; We take all parameters that don't match with known strings and put it into the refinementList in routeToState, and then InstantSearch filters out anything from the state that doesn't match an existing filter. This then gets passed back into the stateToRoute.

Comment thread resources/js/components/Listing/Listing.vue
@royduin royduin merged commit fc7eb3b into master May 1, 2026
15 checks passed
@royduin royduin deleted the feature/utm-fields branch May 1, 2026 07:59
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