Google Tag Manager’s preview and debug mode allows you to browse a site on which your container code is implemented as if the current container draft was deployed, so that you can test a container configuration before it is published. Your previewed site is connected to Tag Assistant so that you can inspect which tags fired and in which order.
Enable preview and debug mode
To enable preview and debug mode for the current workspace:
- Go to https://tagmanager.google.com.
- Sign in to your Google Account. Learn how to create a new Google Account.
- Open the Tag Manager container you want to edit.
- In the Workspace tab, click Preview (top right) to launch Google Tag Assistant in a new tab.
- Enter your site's URL.
- Some sites or pages might be broken by an additional debug parameter added to the URL. If so, you can uncheck the box Include debug signal in the URL.
- Click Connect. Your site opens in a new window and displays as Connected in the bottom right.
If you have installed the Tag Assistant Companion chrome extension your website will open in a new tab rather than a new window.
- Click back on the Tag Assistant tab and click Continue to access the debug interface.
You can also preview your site for debugging from the Tag Assistant activation page.
To preview an older version of a container:
- In the top navigation of your workspace, click Versions.
- Find the version you would like to work with, click More Actions and select Preview.
Use preview and debug mode
Once preview and debug mode is enabled, a new window will launch for the page you entered. The debug interface shows detailed information about your tags, including how tags fired and what data is being processed. The debug interface will only appear on the same browser that was used to enable preview mode, or for shared users, and is not visible to your regular website visitors.
Use the information in the debug interface to find out if tags and triggers fire properly and what data they pass to their respective services. As you click through your previewed website, the debug interface will update information about how your tags are fired. You can use this information to check if a tag fired successfully, and what triggered (or did not trigger) its firing status.
For Server containers, the debug interface has different tabs. Read Preview and debug server containers for more information about using preview mode for server-side tagging.
Share preview and debug mode
When preview and debug mode is enabled, the previewed container configuration and Tag Assistant debug interface are only visible from the same browser from where you activated preview and debug mode. You can share this preview with others with a custom-generated URL.
To share a preview of your workspace configuration with a colleague:
- In Tag Assistant, click More Actions , then select Share.
- In the Share debug session dialog, enter your target website domain and the tags to debug.
- Copy the resulting preview URL from the indicated box.
- Paste the copied preview URL into an electronic message and send it to a colleague. The preview URL lets the user connect to your site in preview mode and to view the Tag Assistant debug interface.
You can also share the current or older versions of a container from your workspace:
- In the top navigation of your workspace, click Versions.
- Find the version you would like to share, click More Actions and select Share Preview.
- In the Share Preview dialog, enter your target website domain (e.g. https://example.com/).
- Copy the resulting preview URL from the indicated box.
- Paste the copied preview URL into an electronic message and send it to a colleague. The preview URL lets the user connect to your site in preview mode and to view the Tag Assistant debug interface.
Exit preview and debug mode
To exit preview mode and stop debugging:
- Click the X in the upper left corner of the Tag Assistant debug interface.
- Click Stop debugging on the Tag Assistant activation page.