Skip to content
ADD-ONS

Preview Header — GTM Server-side Preview mode

Adds an X-Gtm-Server-Preview header for debugging the server-side GTM container in Preview mode.

10 min Read Pokročilý Updated 5.6.2026

What is the Preview Header?

The Preview Header add-on lets you use GTM Server-side Preview mode (debugging) by adding an X-Gtm-Server-Preview header to requests. This is essential for testing server-side tags in Google Tag Manager.

Why use the Preview Header?

  • Debugging: Test server-side tags before deploying to production.
  • QA: Verify that data flows correctly through sGTM.
  • Development: Faster iteration when developing custom tags/variables.

How to activate

  1. Go to Dashboard → Add-ons
  2. Turn on the "Preview Header" toggle
  3. Enter the Preview Header value (you get it from the GTM Preview URL)
  4. Click "Save Preview Header"

How to get the Preview Header value?

  1. In the GTM server-side container click "Preview"
  2. GTM opens a Preview URL: https://track.yourdomain.cz/?gtm_debug=x>m_server_preview=ZXlKMWMyVnlYMmx...
  3. Copy the value of the gtm_server_preview parameter
  4. Paste it into Add-ons → Preview Header → Value

What happens after activation?

DataNostro automatically adds the header to ALL requests heading to your sGTM container:

X-Gtm-Server-Preview: ZXlKMWMyVnlYMmxrSWpvaU1qQXlOQzB...

GTM Preview mode

With the Preview Header active you can see in the GTM interface:

  • Which tags fired
  • Which variables were evaluated
  • Triggers and conditions
  • Request/response data
  • Errors and warnings

Security

The Preview Header is ONLY for development/staging. NEVER leave the Preview Header active in production — it can cause performance issues and logging of sensitive data.

⚠️ Important notice:

After you finish testing, ALWAYS turn off the Preview Header add-on! Preview mode increases request latency by 200-500ms and logs all data to the GTM Preview console.

Recommended workflow

  1. Turn off the Preview Header in production
  2. Create a test subdomain: test-track.yourdomain.cz
  3. Activate the Preview Header only on the test subdomain
  4. After finishing the tests, turn off the Preview Header
  5. Deploy the changes to the production container
Did this article help you?
✓ Thank you for the feedback