The _ga_* cookie is not deleted
-
Unfortunately Google Analytics sets this cookie on the “unload” event, so even if cookies are deleted, when the page is refreshed, the cookie re-appears.
To reproduce include GA on your page. Below is my code, I toggle its inclusion on the page using PHP based on the cookieyes-consent cookie content.
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXX'); </script>
And make sure the
_ga
and_ga_*
cookies and registered in CookieYes.When the banner first appears, accept all cookies and refresh the page, you will see the
_ga
and_ga_*
cookies are set.Now bring up the cookies settings again and disable the cookie category the GA cookies belong to.
Refresh the page and you’ll see that the
_ga
cookie is gone but the_ga_*
cookie persists.
- The topic ‘The _ga_* cookie is not deleted’ is closed to new replies.