whitecube / laravel-cookie-consent

Register, configure and ask for cookies consent in a EU-compliant way
MIT License
312 stars 37 forks source link

Anonymize IP not possible, since google is hard-coded #51

Closed riyuk closed 1 month ago

riyuk commented 2 months ago

Currently the only possible way i can think of is overwriting the whole AnalyticsCookiesCategory class since the script-tag is hard-coded there.

To anonymize the ip address (which is required by law in germany at least) the gtag config should also include a third parameter. So we need gtag(\'config\',\''.$id.'\', { \'anonymize_ip\': true }) instead of just gtag(\'config\',\''.$id.'\')

is this something we can have for the future?

derhofbauer commented 1 month ago

I ran into the same issue and created a PR for it: https://github.com/whitecube/laravel-cookie-consent/pull/55

Maybe it helps :)