- Issue created by @cedric_a
- Merge request !17fix: adds a check to remove the hostname from the query → (Open) created by cedric_a
- Issue was unassigned.
- Status changed to Needs review
7 months ago 10:28am 19 July 2024
Google Tag Manager Consent Mode v2 is adding query parameters under certain conditions to ensure (force) user tracking.
In the context of a view using ajax with facets, after using one facet the view is empty, without errors in the browser nor in the Drupal log nor in the webserver PHP error log.
Debugging lead me to the PrettyPathsActiveFilters class where Url::fromUserInput($q) is receiving an URL that includes the hostname causing an exception (I only see it with xdebug).
Drupal 10.1.8
Facets 2.0.6
Facets Pretty Paths 2.0.1
A view with ajax activated + facets configured to filter the view + facets pretty paths activated as URL processor of the facet source.
Then you need a GTM container on your site with consent mode v2 activated, a consent banner (I used a free version of Axeptio). This configured you need to refuse the consent, then you see a _gl query parameter added tu the URL during navigation.
At this point you should see nothing in your view with facets after some clics on facets.
I haven't found the reason why the hostname is included in this case so I will follow up with a fix proposal where a check is added to remove the hostname if present in the query.
Merge this fix if we can't find a better solution (could we act where the hostname is added?)
None
None
None
Needs review
2.0
Code