Made by Rune Andersen @ Copenhagen, Denmark

How to preview or swap a GTM container without publishing

To preview or swap a Google Tag Manager container without publishing, open the GTM Hub from the Event Watcher toolbar and use the Block, Swap, or Preview action on the container's card: Block cancels the container request at the network level, Swap redirects it to a different container ID, and Preview rewrites it to load an unpublished workspace from a GTM preview share link. Nothing is published and no site code is touched, because the rewrite happens locally in your own browser. Rules apply from the next page load, are scoped per domain, and persist across browser sessions until you disable or remove them.

Last updated:

Why is testing a GTM container change so awkward?

Because both of the built-in options cost you something. Publishing puts an untested change in front of real visitors, and Tag Assistant's preview needs access to that specific container and connects one tab at a time.

Testing Google Tag Manager changes against a real page usually means one of those two compromises. Neither answers questions like "what does this page's tracking look like without GTM?", "what happens if I load our staging container on the production site?", or "can I test a colleague's workspace draft on a page I can't edit?"

Event Watcher's GTM Hub does this at the network level: it can block a container request outright, redirect it to a different container ID, or rewrite it to load an unpublished workspace preview, all locally in your browser, with nothing published and no site code touched.

What do you need before you start?

Event Watcher installed, DevTools open on the Event Watcher panel, and one page load so the container is captured. For the Preview action you also need a GTM preview share link.

Open the GTM Hub from the diamond icon in the toolbar. It lists a card per detected container with its ID, version, tag counts, and the event names read from the container configuration. Generate the share link from Preview → Share in the GTM UI, or copy the Tag Assistant URL before clicking Connect.

How do you block, swap, or preview a container, step by step?

Pick the action on the container's card in the GTM Hub: Block cancels the container request, Swap redirects it to another container ID, and Preview rewrites it to load an unpublished workspace. Every rule applies from the next page load, so reloading is part of the process rather than an afterthought.

  1. In the GTM Hub, find the container card. Containers with no rules show Block | Swap quick actions; the same buttons appear on the container's event in the detail view.
Screenshot: GTM Hub modal showing a container card with ID, version, tag counts, and Block / Swap / Preview actions

/images/screenshots/guides/gtm-intercept-hub-card.png

  1. To test without GTM: click Block. The container request is cancelled at the network level. Reload and see what still fires: hardcoded pixels and scripts loaded outside GTM, such as a gtag.js snippet pasted straight into the page template, become obvious in the stream.
  2. To swap containers: click Swap and enter the replacement container ID (staging, a sandbox, or any container you want to trial on this page). Add an optional note like "QA container for Campaign A" so future-you knows why the rule exists.
  3. To load an unpublished draft: click Preview and paste the GTM preview share link into the Load GTM Workspace Preview form. The extension extracts the gtm_auth and gtm_preview parameters and rewrites the container URL to load that environment. Optionally tick Enable GA4 debug mode to route GA4 events to DebugView instead of regular reports.
Screenshot: Load GTM Workspace Preview form with a pasted Tag Assistant share link and the GA4 debug mode checkbox

/images/screenshots/guides/gtm-intercept-preview-form.png

  1. Rules take effect on the next page load (GTM initializes once and cannot be un-loaded mid-session), so click Reload on the "Reload page to apply changes" banner.
  2. Verify in the stream. An intercept banner above the event stream shows the active rule with a colored Blocked, Swapped, or Preview badge and the container IDs. For a swap, the stream's GTM load line confirms what actually loaded (e.g. GTM Load: GTM-XXXXXXX v12 · 48 tags); the original container's blocked request is hidden since the swap event tells the story.
Screenshot: Event stream with the GTM intercept banner showing a Swapped rule badge and the replacement container loading

/images/screenshots/guides/gtm-intercept-banner.png

  1. When you're done, use Disable (keeps the rule for later, listed under Inactive in the Hub) or Remove (deletes it). Rules are scoped per domain but persist across browser sessions and DevTools closure. Clean up before you forget, or your next visit to the site quietly loads the wrong container.

What does a working intercept look like, and what does a failed one look like?

Working means the intercept banner shows one active rule and the stream shows the replacement or preview container loading with the version and tag count you expect. Failing almost always means the page was not reloaded, or the rule is scoped to a different domain.

Good: after a swap or preview, the intercept banner shows exactly one active rule, the stream shows the replacement or preview container loading with the expected version and tag count, and the tags you changed fire with the new behavior. Verify the specific dataLayer events and pixels in the stream, not just the container load. Blocking cleanly removes all GTM-loaded tags, leaving only hardcoded tracking.

Bad: the banner shows the rule but the stream still shows the production container: you didn't reload, or the rule targets a different domain than the one you're on. A preview rule that returns the production version number means the share link was stale or truncated (the form warns when it can't find gtm_auth and gtm_preview in the pasted value). And tracking that survives a Block is itself a finding: it isn't managed by GTM at all. Trace where it comes from with the dataLayer source guide.

Try it on your own site

Free, no account, runs entirely inside Chrome DevTools.

Add to ChromeFree on the Chrome Web Store

Related platform pages

More guides