Skip to content

gtmIsPreviewMode β€” GTM Variable Template for GTM

VARIABLES β€Ί GTM
gtmIsPreviewMode CORE GTM
Direct (.tpl)

Returns true if the container is running in preview mode.


GTM Utilities

Access GTM-specific APIs: dataLayer, debug mode, container settings.


This is what you'll see when you open this variable in Google Tag Manager.

Read-only Preview
gtmIsPreviewMode
This function takes no parameters.


πŸ“œ View Implementation Code
/**
* Checks if the container is in preview mode.
*
* @returns {boolean} True if the container is running in preview mode, false otherwise.
*
* @framework ggLowCodeGTMKit
*/
const getContainerVersion = require('getContainerVersion');
return getContainerVersion().previewMode;
___WEB_PERMISSIONS___
[
{
"instance": {
"key": {
"publicId": "read_container_data",
"versionId": "1"
},
"param": []
},
"isRequired": true
}
]
πŸ§ͺ View Test Scenarios (1 tests)
βœ… Untitled test 1