Reputation: 73
What I would like to do is to avoid that GA4 automatically add those kind of "_gl=xxx" suffixes to every external link that I have in my webpage.
I've tried almost everything in GA4 property admin, like disabling "click" event tracking, (actually I have disabled automatic event detection and I have disabled user-provided-data too.
In addition I have modified js tracking code doing something like this:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXX', { 'linker': {
'domains': ['midomain.com'],
'decorate_links': false
}
});
</script>
In a "desperate" attempt to disable external links tracking coding.
But nothing seems to work.
NOTE: I have no tagmanager additional configuration implemented on this site, and there is no code/service in my page that could be doing something like adding that "annoying" suffix on my links. In fact if I disable ga4, all those "_gl=xxxxxxxx' url suffix, disappear.
Any Ideas about how to solve it?.
Upvotes: 2
Views: 8102
Reputation: 8111
That string is a client/session id. GA does so to keep the ids consistent across top-level domains as a part of its cross-domain tracking configuration. You likely have poor logic there that flags all domains for cross-domain tracking. You can learn more about it here. Here is how to get there:
- In Admin, click Data Streams in the Property column.
- Click Web and then click a web data stream.
- In the web stream details, click Configure tag settings (at the bottom).
- In the Settings section, click Configure your domains.
Now, if you do need the cross-domain tracking, but want to remove the url parameter that GA adds, then you will need backend support for it. Your backend will have to maintain the connection and set the GA cookie. It's much more complex, but looks elegant on the front-end.
Upvotes: 1