Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Have GA set the same client ID as in non-AMP #5761
Right now, GA sets the client ID as GA1.N.MMM.MMM (when loading AMP page from publisher domain) which is measured as a user being bounced even though the user lands on the same domain. This is because GA sets the client ID as MMM.MMM on non-AMP pages.
Note that this is only applies to the case when using below in the GA config.
To clarify, on non-AMP page, GA SDK writes
On AMP pages of the same publisher domain,
When user navigates from an AMP page to a non-AMP page on the same publisher domain, the user is counted twice.
Given the high priority of this bug, and that the "filter" support (#2198) hasn't landed yet, discussed with @dvoytenko, we'll go for a temporary fix first (hard code the logic to strip-off the leading prefix).
Let us know if any concerns. Meantime, we hope this eventually could be solved at GA server side, @avimehta
However, you should match the definition to a strict clientID in Google Analytics.
"GAa.b-c." is not strictly a client ID, but metadata when saving to a cookie.
Therefore, after retrieving the value from the cookie, you need to send the deleted "GAa.b-c." as ClientID.