Google Tag Manager consent mode on WordPress
Run Google Tag Manager on WordPress with Consent Mode v2: load GTM after the first consent or right away, and make non-Google tags wait for consent.
On this page
Google Tag Manager (GTM) is a container: it loads other tags. Consent Mode v2 covers the Google tags inside it, but GTM can also hold Meta, TikTok, LinkedIn or Hotjar tags that know nothing about Google’s signals. That’s why Omea Consent lets you decide when the container itself loads.
Two ways to load GTM
| After the visitor’s first consent (default) | Right away with Consent Mode | |
|---|---|---|
| When GTM loads | After the visitor accepts any optional category | On page load, before a choice |
| Google tags in the container | Run with the visitor’s choice | Run with denied defaults and send cookieless pings while consent is denied (also after a refusal) |
| Non-Google tags | Can still fire on anything after consent – use triggers | Fire immediately unless you add consent checks |
| Best for | Containers with tags you haven’t audited | Containers where every tag respects consent |
Either way, Omea Consent prints the Consent Mode defaults first and pushes an omea_consent_update event to the dataLayer whenever the visitor chooses.
With Omea Consent Pro (recommended)
- Go to Omea Consent › Integrations and switch on Google Tag Manager.
- Enter your Container ID (
GTM-XXXXXXX). - Under the card, choose After the visitor’s first consent (safest) or Right away with Consent Mode.
- Click Save changes.
Right away with Consent Mode only applies in advanced Consent Mode. In basic mode, GTM always waits for consent. See advanced vs basic.
The card’s own warning is worth repeating: load right away only if every tag in the container respects consent. Google tags follow Consent Mode on their own; other tags need Additional consent checks (for example ad_storage) or a consent trigger in GTM.
With the free plugin
- GTM pasted into Scripts. Paste the GTM head snippet into Omea Consent › Scripts and give it a category – it loads after the visitor accepts that category. See Add tracking scripts that wait for consent.
- GTM added by your theme or another plugin. It loads right away. With auto-blocking on, Omea holds it until the visitor accepts any optional category. To let it load right away instead, turn on Allow Google Tag Manager before consent in the auto-blocking card under Settings › Advanced – the same setting as Pro’s Right away with Consent Mode.
Make non-Google tags consent-aware in GTM
If GTM loads right away, each non-Google tag must wait for consent:
- In GTM, open the tag and go to Advanced Settings › Consent Settings.
- Choose Require additional consent for tag to fire and add the type it needs –
ad_storagefor advertising pixels,analytics_storagefor analytics. - Publish the container.
GTM then holds the tag until Omea Consent sends that signal as granted.
Use Omea’s dataLayer event as a trigger
Every choice pushes omea_consent_update to the dataLayer. Create a Custom Event trigger with that name to fire tags the moment consent changes.
The Omea Consent template for GTM
On WordPress you don’t need it. The plugin already sets Consent Mode in the page head, before GTM loads. If you add the template anyway, it notices the plugin and does nothing.
The template is for pages outside WordPress where GTM adds Omea Consent Pro’s embed line as a Custom HTML tag, or where GTM must own Consent Mode. It sets the same denied defaults (also per region) and applies a returning visitor’s stored choice, with the same category mapping as the plugin. Every later choice reaches Google from the Omea banner itself. One limit: Google Tag Manager can’t read Global Privacy Control, so with the opt-out model the template’s defaults don’t apply it – the WordPress plugin does.
- Get
template.tplfrom github.com/cultmetrics/omea-consent-gtm-template. - In GTM, go to Templates › Tag Templates › New, open the ⋮ menu, choose Import and pick the file. Click Save.
- Go to Tags › New, choose Omea Consent – Consent Mode and set the trigger to Consent Initialization – All Pages.
- Choose the same consent model and regions as in Omea Consent, then publish the container.
Check your setup
Follow How to check Google Consent Mode v2 is working and use GTM’s Preview mode. Adding ?gtm_debug resets the stored choice once per debug session, so you can test the banner from scratch.
Frequently asked questions
Should GTM load before or after consent?
After the first consent is the safest default. Load it right away only if every tag in the container respects consent – Google tags do on their own, other tags need consent checks or a consent trigger.
Do I need a Consent Mode template in GTM?
Not on WordPress. Omea Consent sets the Consent Mode defaults in the page before GTM loads and sends updates on every choice. Remove any other consent default tag from the container so they don’t conflict. The Omea Consent – Consent Mode template is for pages outside WordPress where GTM adds Omea’s embed line.
Does Omea Consent print the GTM noscript iframe?
Omea Consent Pro’s GTM integration doesn’t – without JavaScript there are no consent signals. With auto-blocking on, a GTM noscript iframe from elsewhere is removed, unless GTM is allowed before consent.