Debugging your server container with Preview mode when Measurebase is in front
Preview mode is the first thing people reach for when a tag misbehaves, and the first question when a proxy sits in front of the server container is whether it still works. It does, for both containers, and nothing about it needs a Measurebase setting. What does change is where the debug session attaches, and that explains nearly every empty preview we have been asked about.
The web container: nothing changes
Preview the web container from Tag Manager as always. Tag Assistant connects to your page, and the container itself is served through your tagging subdomain by the Enhanced script, exactly as for a normal visitor. Hits sent while you preview reach your server container with the preview marker; your request logs show them with the type GTM preview mode and the tag PREVIEW · NOT COUNTED, so testing never touches your quota.
The server container: where the session lives
When you click Preview in the server container, Tag Assistant opens the first URL listed under Admin → Container Settings → Server container URLs and asks it for a debug session. That host sets three short-lived cookies in your browser (gtm_auth, gtm_debug, gtm_preview) and from then on polls the same host for events. A hit joins the session when it reaches the container with the preview header, which the browser only attaches for hits that go to the host holding those cookies.
Two consequences:
- The first server container URL must be the address your site actually sends to: your tagging subdomain, or your Same-Origin Tracking address when that is on. With Same-Origin Tracking the hits go to
www.yoursite.com/mb; if Tag Assistant openedmbase.yoursite.cominstead, the cookies sit on the wrong host and the preview stays empty. The audit flags this as a finding on the domain; the fix is to move the Same-Origin address to the top of the list. - Measurebase forwards the preview header untouched, so the request passes through to the container the way Google expects. Hits carrying it also bypass IP Filter, so you can test from an office address you otherwise exclude.
Getting test hits into the session
- From your site: browse it in the same browser profile where Tag Assistant runs. Every GA4 hit then carries the header and shows up as an incoming request with the client that claimed it, the event data and, with Data Enrichment on, the
X-GEO-*andX-Device-*headers your server tags read. - From Shopify checkout: the checkout runs in a sandbox that has no access to your cookies. The Measurebase app bridges that: switch on the server preview header in the app's Test tab and the app passes the current preview token with every checkout hit, so
begin_checkoutandpurchaseappear in the session. It switches itself off after 24 hours. - Consent-gated tags: turn on Auto Grant Consent while you test, so you do not have to click through your own banner for every run, and switch it off afterwards.
When the preview stays empty
- Restart Tag Assistant properly. Close the preview tab and the debug tab, start Preview again from the server container. The pairing between your browser and the debug session is kept at Google's end and sometimes goes stale, even though the preview token itself stays the same for days. A fresh start fixes most empty previews; comparing tokens tells you nothing.
- Check that hits arrive at all. Open the domain's request logs while you browse. No rows means the site is not sending to this tagging subdomain yet; rows without the preview type mean the browser is not attaching the header, usually because of the host mismatch above or a different browser profile.
- Check the host. The first server container URL in GTM must equal the host in your request logs. A hit answered with 200 but missing from the preview is a hit the container did not consider part of an active session; a 403 means the header belongs to a different container.
- Look for an ad blocker in your own browser. Tag Assistant and the debug polling are on common block lists. Allow your own site and tagassistant.google.com while debugging.
- One container at a time. A debug session pairs with one server container. Domains that share a container share a preview; domains with their own container need their own session.
Reading what you see
The left pane lists incoming requests from the GA4 client; the Tags tab shows which server tags fired on each event and why. Values that come from Measurebase appear as request headers on the event: country, city, device, browser and bot flag with Data Enrichment, a masked IP with IP Anonymization, and mb_profit on purchases with Profit Tracking. If a server tag reads one of those and shows undefined, the power-up is off for this domain or the variable name does not match the header.
Frequently asked questions
Can I preview the production container and a workspace at the same time?
Preview always runs the workspace you started it from, against the live hits. The audit's proposed fixes land in the separate Measurebase workspace, so preview that workspace to see them before you publish.
Do preview requests count toward my quota?
No. They are logged, labelled and excluded from the billable count.