On my site, if user refuses to use cookies (according to the EU e-privacy directive), I block tracking of Google Analytics using the JavaScript ,
window['ga-disable-UA-XXXXXX-X'] = true;
With this command tracking is disabled and seems to work (if I surf on the site, Google Analytics doesn't see any activity).
But I notice that __utma
, __utmb
,.... cookies are still on my browser (in Chrome), so I tried to delete them with setcookie
function of php:
foreach ($_COOKIE as $key => $value) {
setcookie($key, '', time()-1000,'/','.mydomain.com');
}
But without success! (I inserted this code after the GA monitoring JavaScript) GA cookies are ever on my browser.
So, Can I delete GA cookies?
Or Is enough blocking GA tracking for EU e-Privacy Directive?