简体   繁体   中英

How to use Google Analytics in a way that's compliant with EU law?

I want to use Google Analytics on my static website, but I don't want to use third party cookies or collect information in order to comply with EU law and not annoy my visitors with popups.

In my case I'm only interested to know approximate pageviews and referrer. All the other information that Google Analytics usually provides is not interesting to me.

So it it possible to get a "light" version of Google Analytics that provides a lot less statistics, but complies with EU law? If not, are there other frontend tools that can help me with this? Or should I build my own analytics Solution?

Edit: My hosting company only allows for static content. So only HTML/CSS and JS.

You might consider some settings available with GA "analytics.js" tracker.

Cookie duration:

ga('create', 'UA-XXXXX-Y', { 'cookieExpires': 34128000 }  /* 13 months */ });

IP Anonymization (at least less precise geolocation):

ga('set','anonymizeIp', true);

Ad features disabling:

ga('set', 'allowAdFeatures', false);

And, if you prefer to track URLs without GET parameters you can't trust:

ga('send', 'pageview', window.location.protocol+'//'+window.location.hostname+window.location.pathname);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM