How to use WordPress GDPR Cookie Consent plugin for Google Analytics

764 Views Asked by At

I add the GDPR Cookie Consent plugin in my WordPress application. When the use disables non necessary cookies, the Google Analytics should be blocked otherwise enabled. At the GDPR plugin I find two fields for that:

This script will be added to the page HEAD section if the above settings is enabled and user has give consent.

and

This script will be added right after the BODY section if the above settings is enabled and user has given consent.

There I can leave JavaScript code. Than I find the Google support page: developers.google.com/analytics/devguides/...disabling_cookies

But I cant get it together. This is to complicate for me. I know my GA Tracking ID.

Which JavaScript code do I need to implement in which GDPR plugin field?

Thanks a lot!

1

There are 1 best solutions below

0
On

You may please copy the Google Analytics tracking code from the analytics account as mentioned here and copy it to the head script section on the cookie consent plugin you mentioned.