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
- Go to Dashboard → Add-ons
- Turn on the "Preview Header" toggle
- Enter the Preview Header value (you get it from the GTM Preview URL)
- Click "Save Preview Header"
How to get the Preview Header value?
- In the GTM server-side container click "Preview"
- GTM opens a Preview URL:
https://track.yourdomain.cz/?gtm_debug=x>m_server_preview=ZXlKMWMyVnlYMmx... - Copy the value of the
gtm_server_previewparameter - 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
- Turn off the Preview Header in production
- Create a test subdomain:
test-track.yourdomain.cz - Activate the Preview Header only on the test subdomain
- After finishing the tests, turn off the Preview Header
- Deploy the changes to the production container