Works with your stack
Cookie consent for GTM4WP
the container waits
GTM4WP adds your Tag Manager container to the head of every page. It has no setting to wait for consent, so the container loads before the visitor chooses. Cookie Rocks holds it and lets it load after a yes, on the same page.
By Thomas Geiger · gtm4wp.com · WordPress.org
Is this your product? Tell us if anything here is out of date. Write to us
GTM4WP
WordPress plugin
- Tested version
- 2.1.1
- How
- Tested automatically around each Cookie Rocks version
- Last test
- 7 November 2026
- Latest version
- 2.1.1 tested
- Active installs
- 700,000+
What GTM4WP adds to your visitors’ browser
Trackers it loads
- Google Tag Manager →Statistics, Marketing1 browser storage key
- Google Analytics / Google Ads (gtag.js) →Statistics, Marketing1 browser storage key
What matters for consent with GTM4WP
The container loads on every page
Once a container ID is set, GTM4WP prints the Google Tag Manager container in the head of every page. It does not ask about consent and does not read WP Consent API.
Held until the choice
Cookie Rocks holds the container before the choice and loads it after Accept all, without a reload. GTM4WP itself set no cookie of its own on that page.
One set of Consent Mode defaults
GTM4WP can print Google Consent Mode defaults, but this option is off out of the box. It never sends the update after the choice: that is the consent plugin’s job. Leave it off when your consent plugin already sets the defaults, so they are not sent twice.
Cookie Rocks with GTM4WP
- Holds the scripts it adds to your pages, such as tags, pixels or a chat, until the visitor consents. In advanced Consent Mode, Google’s tags load with consent denied instead.
- Counts it as a Google setup and recommends basic or advanced Consent Mode for your site.
What our tests found on GTM4WP
Good to know · GTM4WPWhat GTM4WP stores in visitors' browsers
GTM4WP: 2 cookie(s) or browser key(s) for visitors, recognised by Cookie Rocks from 2.9.8.
Name Kept in Category What it is for gtm4wp_user_logged_incookie Statistics Tells Google Tag Manager that the visitor just signed in or registered gtm4wp_user_registeredcookie Statistics Tells Google Tag Manager that the visitor just signed in or registered Read in its code, 2 November 2026, GTM4WP.
Full detail
GTM4WP can store these in a visitor's browser: gtm4wp_user_logged_in (cookie, statistics: Tells Google Tag Manager that the visitor just signed in or registered); gtm4wp_user_registered (cookie, statistics: Tells Google Tag Manager that the visitor just signed in or registered). Cookie Rocks recognises them from 2.9.8, with this category and purpose, and lists them in the cookie policy when it sees them.
Good to know · GTM4WPGTM4WP loads each video tracker only when its player is on the page
Each tracker is a local file and fetches its player API only with a matching embed. In the test, allowing YouTube or Vimeo loaded only that player, not the container.
Seen in our tests, 18 October 2026, GTM4WP 2.0.6.
Full detail
GTM4WP prints the GTM container as one inline script and keeps each video tracker in its own local file (gtm4wp-youtube.js, gtm4wp-vimeo.js and others). A tracker fetches its player API only when a matching embed is on the page, and every tracker depends on the local file gtm4wp-media-gate.js. In the test, allowing YouTube or Vimeo loaded only that player, and the container did not start.
Good to know · GTM4WPGTM4WP does not track YouTube videos embedded from youtube-nocookie.com
The YouTube tracker of GTM4WP watches only iframes whose src starts with https://www.youtube.com/embed. A video embedded from youtube-nocookie.com is not tracked: the tracker did not load www.youtube.com/iframe_api for it.
Seen in our tests, 18 October 2026, GTM4WP 2.0.6.
Good to know · GTM4WP (GTM for WordPress)Cookie Rocks holds the GTM4WP Tag Manager container until Accept all
On a test WordPress with GTM4WP 2.0.6 and a dummy container ID, Cookie Rocks holds gtm.js before the choice and loads it after Accept all, without a reload. GTM4WP set no cookie or browser storage of its own on that page.
Seen in our tests, 17 October 2026, GTM4WP (GTM for WordPress) 2.0.6.
Depends on a setting · GTM4WP (GTM for WordPress)GTM4WP's Consent Mode option can send Google's default twice
setting “Google Consent Mode (integrate-consent-mode)” · by default: off
Off by default. When on, it sets Google's default consent before the container, with every signal denied except those ticked, and never sends an update after the choice.
What to do: Leave it off when the consent plugin already sets the defaults, so the default is not sent twice.
Read in its code, 16 October 2026, GTM4WP (GTM for WordPress) 2.0.6.
Full detail
GTM4WP's Google Consent Mode option is off by default. When on, it prints gtag('consent','default') before the container with all seven signals denied except those ticked, with no region and no wait_for_update. It never sends an update after the choice: that is left to the consent plugin. The filter gtm4wp_consent_mode_default_enabled (false) removes this default, and gtm4wp_overwrite_consent_mode_flag changes one signal.
Set before the choice · GTM4WP (GTM for WordPress)GTM4WP loads Tag Manager on every page with no wait for consent
Once a container ID is set, gtm.js loads in the head of every page. GTM4WP has no wait-for-consent setting and does not read WP Consent API.
Read in its code, 16 October 2026, GTM4WP (GTM for WordPress) 2.0.6.
Full detail
GTM4WP always loads the Tag Manager container (gtm.js from www.googletagmanager.com or a custom domain) in the head of every page once a container ID is set: wp_head priority 10 (2 with its load-early option), after its data layer block at priority 1. It has no wait-for-consent setting and does not read WP Consent API. Its inline blocks carry data-cfasync="false" and data-pagespeed-no-defer.
Depends on a setting · GTM4WP (GTM for WordPress)GTM4WP media tracking loads player scripts only when it finds a video
setting “Media events” · by default: off
Off by default. When on, it requests the YouTube, Vimeo and other player scripts only when it finds the provider's frame, so a banner that holds the frame also prevents the request.
Read in its code, 16 October 2026, GTM4WP (GTM for WordPress) 2.0.6.
Full detail
GTM4WP's media events options are off by default. When on, the player SDKs (YouTube iframe_api, Vimeo, SoundCloud, Wistia, Twitch, Dailymotion and others) are requested by JavaScript only when the provider's iframe is found by its src address, so a banner that moves src to data-src or shows a placeholder prevents the request. The filter gtm4wp_media_sdk_blocked (true) holds all SDK requests, and the gtm4wp-media-gate script can be blocked.
Good to know · GTM4WP (GTM for WordPress)GTM4WP's WooCommerce integration stores small values only after an action
- gtm4wp_item_list_attr: cookie, 3 days, when a product is clicked in a list.
- gtm4wp_orderid_tracked: localStorage on the order received page, or a 365-day cookie.
- gtm4wp_readded_to_cart: localStorage.
- Cache-safe data layer option (off by default): gtm4wp_woo_event, gtm4wp_login, gtm4wp_visitor_session.
Read in its code, 16 October 2026, GTM4WP (GTM for WordPress) 2.0.6.
Full detail
GTM4WP's WooCommerce integration writes small first-party values only after an action: gtm4wp_item_list_attr (cookie, 3 days, when a product is clicked in a list), gtm4wp_orderid_tracked (localStorage on the order received page, or a 365-day cookie if localStorage is unavailable) and gtm4wp_readded_to_cart (localStorage). Its cache-safe data layer option (off by default) adds gtm4wp_woo_event (2 days), gtm4wp_login (logged-in users) and sessionStorage gtm4wp_visitor_session.
How we test it
Around each version, with its latest release
Around each Cookie Rocks version, a fresh WordPress installs its latest version from WordPress.org next to Cookie Rocks and runs the same checks. A new version joins the next run on its own.
- GTM4WP 2.1.1, tested on 7 November 2026.
- The banner shows, the trackers of the test page wait for consent and load after it, and Cookie Rocks raises no PHP error.
- Its own tags, set with a test ID, do not load before the choice and load after “Accept all”.
- Settings of the test: GTM container ID (test value).
- Last run: GTM4WP 2.1.1 on 7 November 2026, with WordPress 7.1.4.
Other plugins of the same kind.
Questions
Should I switch on Consent Mode in GTM4WP?
Not if your consent plugin already sets the defaults. Two sets of defaults on one page only make the result harder to read.
What happens after the 30-day trial?
The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.
For GTM4WP users
Keep GTM4WP, hold the container.
gtm4wp stays on
Every feature of the complete plugin for 30 days, no card. GTM4WP keeps working as it does today.
- During the trial: everything, including the full settings and the scans
- After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
- What waits for a key: most settings, updates and support

Get your trial key
Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.