Skip to content

EARN UP TO 50% COMMISSION WITH OUR RESELLER ACCOUNTS + REGULAR PASSIVE INCOME SIGN UP TODAY

Install CookieScan

Fire tags on consent in Tag Manager

Use CookieScan's consent events in Google Tag Manager to fire tags, such as ad pixels, only after a visitor accepts their category.

Updated 3 min read

Applies to:
  • Tag Manager & Consent Mode

https://cookiescan.com/help/fire-tags-on-consent-in-tag-manager/ Β· Updated 12 October 2026

On this page

Before you start

Note: Plans

The Google Tag Manager events setting is on Premium and Enterprise plans.

You need CookieScan installed with either method, and Google Tag Manager on every page of your website.

Google tags don't need these events, because they read Google Consent Mode. Use the events for tags that don't read Consent Mode, such as many ad pixels and chat widgets from other companies.

Turn on Tag Manager events

  1. Open the banner settings

    Go to Cookie Banner, then Settings.

  2. Tick Google Tag Manager events

    Under Premium account features, tick Google Tag Manager events.

  3. Save your settings

    Select Save & Publish.

The events CookieScan sends

CookieScan adds an event to the data layer for each category the visitor has accepted. Use the event names exactly as written.

EventSent when
cookie-consent-necessaryThe visitor has made a choice on your banner.
cookie-consent-preferenceThe visitor accepted Preference.
cookie-consent-statisticsThe visitor accepted Statistics.
cookie-consent-marketingThe visitor accepted Marketing.
cookie-consent-unclassifiedThe visitor accepted Unclassified.

CookieScan sends the events on every page, once your banner has loaded. After a new choice, it sends them straight away if Seamless consent (no page reload) is on. Otherwise the page reloads and it sends them on the reloaded page. Tag Manager events has the full details.

Create a trigger for each category

  1. Create a new trigger

    In Tag Manager, go to Triggers and select New.

  2. Choose Custom Event

    Select Trigger Configuration, then Custom Event.

  3. Enter the event name

    In Event name, enter the event for the category, such as cookie-consent-marketing.

  4. Save the trigger

    Leave All Custom Events selected. Give the trigger a name, such as CookieScan Marketing consent, and select Save.

Repeat these steps for each category your tags need.

Fire your tags on the new trigger

  1. Open the tag

    Open a tag that needs consent, such as a Marketing pixel.

  2. Replace its trigger

    Remove its current trigger, such as All Pages. Add the CookieScan trigger for the tag's category.

  3. Publish your container

    Select Submit, then Publish.

Warning: Remove the old trigger

A tag that still has All Pages or another page trigger fires before the visitor consents. Each tag should keep only its CookieScan trigger.

Check it worked

  1. Preview your container

    In Tag Manager, select Preview and open your website in a private window.

  2. Check before you choose

    No cookie-consent- events appear, and your tag doesn't fire.

  3. Accept on your banner

    Select Accept all. The events appear, after the reload if the page reloads, and your tag fires.

Note

With Geo-Awareness on, a visitor from a country that doesn't need consent starts with every category allowed. CookieScan then sends the category events from their first page.

Add these tags' cookies yourself

A scan doesn't fire tags that wait for these events, because the scanner never makes a choice on your banner. So your scan doesn't find the cookies those tags set.

Add each of those cookies yourself at Cookie Manager, then Add Cookie, in the category its tag waits for. See Can I add a cookie the scan missed?

Next steps

Was this article helpful?

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks, your comment has been sent.

Sorry, we couldn't record your feedback. Please try again later.

Still stuck?

Our support team can help with anything these guides don't cover. Tell us your CookieScan ID and the page address so we can look straight away.

Back to Install CookieScan