1

I'm following the guide from Cookiebot to implement the cookie banner with Google Tag Manager that explicitly states that:

Please note: If your existing trigger is of the event type "Page View", you need to change it to event type "Window Loaded" since the visitor's consent is not available to GTM before the window has loaded.

Practically, to be fully compliant, before firing the Google Analytics tag we need to check for the visitor's consent about cookies and to get the visitor's choices from Cookiebot, we need to wait for the "Window Loaded" event: before this event, Cookiebot cannot get the correct value for the choice (and I don't know why).

But all the Google's guides about how to configure Google Analytics through Google Tag Manager use the track type "Page view", that is earlier than the "Window Loaded" event.

So, my question is:

What are the drawbacks, if any, of switching Google Analytics' tag from "Page view" track type (as suggested anywhere by Google) to "Window Loaded" track type (as suggested by Cookiebot)?

1 Answer 1

0

all the recommendations on firing GA tags at "pageview" event do not account for GDPR compliance. PageView event is fired at the moment when the browser is only starting processing the page content before any interaction took place. Therefore no no visitor's choice on cookie was made.

The easiest way to fire GA tag with Cookiebot consent is to fire GA tag with cookieconsent_statistics custom event that indicates proper visitor approval (p.2 at cookiebot guide)

2
  • I know how to fire tags in compliance with cookie law (ePrivacy directive) at PageView event and not at Window Load event. My question is different: why is so important to fire the tag at Page View time and not at Window Loaded time (that is far easier as I only need to use the API provided by Cookiebot).
    – Aerendir
    Commented Jul 16, 2019 at 17:28
  • Because of order of GTM events and Cookiebot processing Commented Jul 16, 2019 at 17:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.