Skip to main content

Conditioning a GTM tag that should fire on all pages upon user consent

Alexandre Dias Da Silva avatar
Written by Alexandre Dias Da Silva
Updated this week

This article is part of the series on cookie blocking using Google Tag Manager.

Before following the guide below, make sure you’ve read the article Condition Your GTM Tags to Consent: Introduction.

Looking to condition a tag that should fire only when a specific event occurs? Head over here!

Some tags need to be present on every page of the site as soon as it loads, such as:

  • GA4 configuration tag and global Google Ads tag

  • Facebook, Pinterest, TikTok pixels, etc.

They are often configured with the “All Pages” trigger in GTM, which fires the tag systematically, without taking user consent into account.

To make this type of tag compliant, you must replace “All Pages” with a custom event trigger that listens for the event axeptio_activate_<service_name>.

This ensures your consent-based tags only fire once the user has accepted the corresponding service (e.g., Facebook Pixel). To do this, you’ll need to modify your tag triggers using the appropriate Axeptio custom event.

Retrieving the list of events in Axeptio

  • Go to your project, then open the cookie configuration you want to work on.

  • Click the Integrate on your site button at the top left.

  • Scroll down to the third section: Saving user preferences.

You will find a list of events grouped according to the steps of your Axeptio widget.

Modifying GTM tag triggers

Capture_d_e_cran_2022-03-08_a__11.24.58.png
  1. Open your GTM container interface.

  2. Select the tag you want to edit.

  3. Go to the Triggering section.

💡 You’ll see a “+” icon to add new triggers, and a “–” icon next to any existing ones.

  1. Remove the existing triggers, then click “+” to create a new one.

  2. In Trigger Configuration, GTM will display a list of trigger types.

  3. Scroll down and choose Custom Event.

  4. Copy-paste the desired event name into the Event Name field.

  5. Give your trigger a name (top left).

  6. Save it (top right).

✅ Your tag will now fire only after the user has given their consent.

Example: Facebook Pixel tag and its trigger

  • The tag

    Capture_d_e_cran_2022-03-15_a__11.24.21.png

  • Its trigger

    Capture_d_e_cran_2022-03-08_a__10.54.43.png

Did this answer your question?