GTM parameters are not preserved, or passed to GTM

On stable, when Ember is rewriting the URL, it removes any “unknown” query parameters, including things like gtm_source, before they can be passed to for instance Google Tag Manager.

Is there any existing solution for this?

3 Likes

There is a workaround here, but it’s definitely not ideal:

I opened a topic on the Ember forum about it, but it doesn’t seem like there is any clean way to allow all params:

The workaround suggested there could potentially work if you know the parameter names up-front.

It could be interesting to experiment with a theme component which takes a list of query param names (e.g. gtm_source), and modifies controller:application to include them. :thinking:

Hmm, no, that’s something different.

I just found out this is an issue on stable only,
what I also found is that (on stable) some parameters are being kept, like pp, safe_mode and such. But I can’t find where these are defined or how to add to them.

On tests-passed all query parameters stay, so to summarize:

…and then I found this fix.

Is there any chance of it being backported to stable? Seems it does not have any dependencies so it should be safe.

1 Like

Ahh I see. I was thinking of links within the site, which are affected by that ember limitation. But you’re talking about query params being rewritten as soon as you land on the site :ok_hand:

Sure, let’s do it :+1:

2 Likes