Installing CookieHub in GTM takes a few minutes. Knowing it works is the harder part. A banner that appears on screen tells you nothing about what the tags did before the visitor clicked. So this guide spends a little time on the setup and most of it on the test.
Install the template on the right trigger
CookieHub's GTM instructions use a community template. In short:
- Create a new tag and open the Community Template Gallery.
- Search for the CookieHub CMP template and add it.
- Enter the 8-character domain code from your CookieHub dashboard.
- Set the trigger to Consent Initialization - All Pages.
- Save it, and test before you publish.
The trigger matters most. The template reads the stored consent cookie while this trigger runs, so the visitor's choice is available before Page View tags execute. Google is just as firm on order: if your consent code is called out of order, the defaults will not work. If an older CookieHub template is already in the container, CookieHub says to remove it and install the community template.
Load your tags through GTM too. CookieHub notes that its automatic cookie blocker cannot block scripts placed directly in your site's HTML.
Decide what happens before consent
Two settings decide this, and they should be deliberate choices.
