I have this following very specific use case that I cannot find any documentation for. I don’t know if it’s even possible, but the objective is to prevent GA4 to append its own parameters in the url when clicking a link sending the client to a subdomain of the current one while not affecting the session tracking.
Context:
I have 3 domains that I will reference with numbers :
www.domain.tld (1)
brand1.domain.tld
(2)storename.myshopify.com
(3)
GA configuration does have cross-domain measurement activated
GA configuration has the following configuration under admin -> data streams -> tag settings -> tag settings -> domains settings :
- contains => domain.tld
- contains => storename.myshopify.com
I tried multiple cookie_domain configurations during GA initialisation with either domain.tld
, .domain.tld
or auto
as follow :
[...]
GAOptions.cookie_domain = 'auto'
gtag('config', 'G-XXXXXXXXXX', GAOptions);
Looking at cookies, all of these options does make available the GA cookies for all subdomains of domain.tld and they all share the same values.
Problematic
The initial objective is to track the user sessions going from (1) or (2) to the shopify checkout (3) which is not a domain.tld domain. While keeping this functional, we would want to prevent GA from appending _gl
, _ga
and all other query parameters it wants when a user clicks on a link redirecting to a subdomain (1) or (2) of domain.tld
.
Google documentation is only explaining that cross-domain measurement don’t need to be activated to track sessions between (1) and (2), but the (3) requires it.
Questions
- Is this even possible and how can I configure to prevent GA url query params to be present?
- Will this duplicate the user sessions in the actual analytics reports when people go back and forth from domain to domain?
- We observed that removing the
contains => domain.tld
(keeping only myshopify one) from GA domain settings removes most of the parameters, leaving only the_gl
one. What are the effect of that on analytics data (after few days with this removed, no noticeable effect was visible on GA reporting from my non-expert eyes)?
I know it’s very specific, but all the questions can be answered separately. The main objective of all of this is to get a solution or explication about question 1.