GTM Kit normally loads on every frontend page. The Exclude pages from GTM feature lets you list URL patterns where GTM Kit should stay off entirely. On a matching page the plugin emits nothing: no container script, no <noscript> fallback, and none of the supporting data layer scripts.
When to exclude a page
Use this when a page should not run Google Tag Manager at all. Common cases:
- Third-party checkout iframes that run their own tracking.
- Partner-hosted or white-label subpages where you do not want your container firing.
- In-app webview routes that have their own analytics.
- Internal preview or staging routes you want kept out of analytics.
If you instead want to stop loading the container everywhere while still pushing events to the data layer, see Disable container injection. That is a global switch; this feature is per-URL.
Add an exclusion pattern
Go to GTM Kit, Settings, Container and find the Exclude pages from GTM section. Add one URL pattern per row and save. An empty list means GTM Kit loads on every frontend page, which is the default.
How matching works
Patterns match against the URL path only. The query string is ignored, matching is case-insensitive, and a single trailing slash is normalised away. If you paste a full URL into a glob row, GTM Kit collapses it to its path when you save.
There are two matching modes:
- Glob (default). Shell-style wildcards anchored to the start of the path.
*matches any run of characters including/, and?matches a single character. For example,/checkout-iframe/*matches every page under that path. - Regex (opt-in). A raw regular expression for advanced matching. A pattern that fails to compile is rejected when you save. If a broken pattern ever reaches the frontend, it is treated as no match, so the container stays on rather than risk turning off tracking site-wide.
What gets suppressed
On a matching page, GTM Kit withholds everything together: the head loader script, the <noscript> iframe after <body>, and the settings, data, and data layer scripts. The page renders as if GTM Kit were not installed.
Works with full-page caching
The exclusion decision depends only on the request path, so it is correct behind full-page caches such as Cloudflare, Varnish, and LiteSpeed. A cached excluded page stays excluded, and a cached normal page keeps GTM Kit.
Verify it worked
Open an excluded page in an incognito tab, clear any caches first, and view source. Search for your container ID. It should be absent on the excluded page and present on a normal page. In the DevTools console, window.dataLayer should be undefined or untouched by GTM Kit on the excluded page.
For developers
Two filters let you control the pattern list and the per-request decision from code: gtmkit_excluded_url_patterns edits the effective pattern list, and gtmkit_is_url_excluded is the final per-request override. The existing gtmkit_container_active filter now receives the computed gate value, so a pass-through callback honours the exclusion automatically. See Settings, actions and filters for developers.