Is there a setting on Google Analytics to suppress use of cookies for users who have not yet given consent

后端 未结 13 1267
深忆病人
深忆病人 2020-12-02 03:33

According to EU Article 5(3) of the E-Privacy Directive (a.k.a \'The Cookie Laws\'), web sites that target EU users have to gain opt-in consent from users before they set a

13条回答
  •  既然无缘
    2020-12-02 04:12

    You can disable google analytics cookies by adding this code at the top of google analytics code (before line: var _gaq = _gaq || [];):

    ga('create', 'UA-XXXXXX-XX', {'storage': 'none'});
    ga(function(tracker) {
      var clientId = tracker.get('clientId');
    });
    

    However some features of google analytics (for example real time stats) do not work properly after this modification. More about google analytics cookies: https://developers.google.com/analytics/devguides/collection/analyticsjs/domains?hl=en#disableCookies

提交回复
热议问题