Problem/Motivation
When ' Enable cookie(s) automatic-removal when consent isn't given. ' is checked, Google Analytics cookies are auto-deleted on first page load, even if they are whitelisted.
Steps to reproduce
Load GA in Google Tag Manager. Block loadng of GTM entirely where no consent is given. Use Smart IP set up with Varnish, with JS geolocation, and with session_cache module set to store location in a cookie. Check ' Enable cookie(s) automatic-removal when consent isn't given. ' Load a page and watch GA cookies appear then being auto-deleted.
When we enable EU Cookie Compliance we expected out traffic numbers in Google Analytics to drop for GDPR countries. Since we were not asking for consent from US visitors, we did not expect US traffic to drop. In fact returning visitors from US did not drop, but numbers for new visitors from US dropped sharply. We currently suspect that the auto-deletion of cookies after first page load, for US users where no banner is shown, was the cause.
Proposed resolution
It seems a bit of an edge case. We have fixed it by unchecking ' Enable cookie(s) automatic-removal when consent isn't given. ' I do think it is a real bug. However, I leave this issue here partly in case others are struggling with the same problem. I am not planning to work on a fix, since our use case is met by unchecking ' Enable cookie(s) automatic-removal when consent isn't given. '
Comments
Comment #2
john_b commentedComment #3
svenryen commentedThanks for the report, John_B. We'll take a look.
Does this affect any cookie, or only Google Analytics cookies when loaded through GTM?
Comment #4
john_b commentedDifficult to answer without changing our GTM config which I am not keen to do.
Also I think the issue may be wrongly described. We are deep in debugging why our Google Analytics results collapse (but not to zero) for new users outside GDPR countries. I have just removed Varnish from our server, and set session_cache to use $_SESSION storage. Probably best not spend time on this until we have got further with our debugging because the problem may be from a different source.
Comment #5
svenryen commentedComment #6
john_b commentedI am setting this to 'Closed (works as designed)'. I did contemplate changing the title but if our problem deserves a ticket at all, a new ticket may make more sense.
I have opened a new tickt explaining our problem, which may be useful for others, and which includes a possible solution: #3217266: Does not work with Geolocation + Google Tag Manager.