Google Tagmanager – fire tags on cookie banner update

Trigger: Create a “consent updated” trigger in google tag manager

  1. create a “custom event trigger”
  2. Event name: beautiful_cookie_consent_updated

Tag: Add the trigger to the tags

Add the created trigger to the tags, which shall fire when the consent is updated.

I will use a google analytics page view tag as example.

That should be it. Now it fires a page view, if a user updates the banner settings and has the correct consent.

Please be aware that this might cause under certain circumstances duplicate page views. But that should be edge cases. If you do not have a SPA you can change the advanced setting “Tag firing options” to “Once per page”. But please only do if you know what you are doing.