How do you use the preview mode in GTM and what is it used for?
There are three instances when you use the preview mode in Google Tag Manager. The three moments when you will need to use the preview mode are:
Create new tags and triggers
Validate of your current tags and triggers are fired
Changes made to your site
When you create new tags and triggers, you will always need to use the preview mode before publishing your container. To test these new tags and triggers, click on ‘Preview’ in the respective container at the top right.
Enter the URL of the website linked to that container within the popup in the preview window.
Your site will now open in a new tab in a test environment. You can see that this is the test environment because the favicon in the tab has changed to that of the Google Tag Assistant. A popup from the Tag Assistant will also appear on that page.
For example, if you have set up a tag and trigger for a specific button on a specific page of your site, navigate to that page in this test environment. Perform the action (in this case, clicking the button). In the preview mode on your other tab, you can then see which tags have fired and which tags have not. You can also view this per page and per session event in the vertical left menu.
If the desired tag does not fire on the desired action, you will need to follow the steps outlined in the section below.
If you notice within your platforms like Meta or Google Analytics that certain events are not or are incorrectly recorded, the first thing you should check is whether the tags and triggers in Google Tag Manager are still firing correctly. These steps should also be taken if, when creating new tags and triggers, you find that they are not firing in preview mode.
The first step is to perform the action that should trigger the tag. Then select that session event in the vertical left menu.
In the list of not fired tags, select the tag that should have fired. You will then see an overview of why it did not fire under ‘Firing Triggers’.
In the example in the screenshot above, you can see that the tag would only fire when the link click text is ‘Create free AdPage Tagging’.
To see what click text the button you clicked has, go to the session event of that click in preview mode. Click on the ‘Variables’ tab as shown in the screenshot below.
If you scroll through all these variables for that one session event, you can see which ones are linked to that event. In the case of the link click with the click text ‘Create free AdPage Tagging’, we check which click text is used for this button. As you can see in the screenshot below, it’s “Read more”.
Now you know what to change in your trigger for that specific tag to make it fire. And this same process works for all your tags and triggers, not just for link clicks.
When you make changes to your site, such as changing your URLs, updating your button and link texts, modifying the purchase process, or updating your DataLayer, you will want to ensure that this does not affect your measurements.
If you open your site in the test environment of preview mode, you can check all your changes and perform the events. Within your preview mode, you can then track which tags are and are not fired.
When tags have not fired that should have, click on the event in the vertical left menu where you expected that tag to fire. Once you have selected that event, you can click on the not-fired tag to see what went wrong with the trigger.
Within that tag, you can then see why the trigger did not work. Based on what went wrong, you can make adjustments to that trigger.
Create new tags and triggers
Validate of your current tags and triggers are fired
Changes made to your site
New tags and triggers created
When you create new tags and triggers, you will always need to use the preview mode before publishing your container. To test these new tags and triggers, click on ‘Preview’ in the respective container at the top right.
Enter the URL of the website linked to that container within the popup in the preview window.
Your site will now open in a new tab in a test environment. You can see that this is the test environment because the favicon in the tab has changed to that of the Google Tag Assistant. A popup from the Tag Assistant will also appear on that page.
For example, if you have set up a tag and trigger for a specific button on a specific page of your site, navigate to that page in this test environment. Perform the action (in this case, clicking the button). In the preview mode on your other tab, you can then see which tags have fired and which tags have not. You can also view this per page and per session event in the vertical left menu.
If the desired tag does not fire on the desired action, you will need to follow the steps outlined in the section below.
Checking if your current tags and triggers are still firing
If you notice within your platforms like Meta or Google Analytics that certain events are not or are incorrectly recorded, the first thing you should check is whether the tags and triggers in Google Tag Manager are still firing correctly. These steps should also be taken if, when creating new tags and triggers, you find that they are not firing in preview mode.
The first step is to perform the action that should trigger the tag. Then select that session event in the vertical left menu.
In the list of not fired tags, select the tag that should have fired. You will then see an overview of why it did not fire under ‘Firing Triggers’.
In the example in the screenshot above, you can see that the tag would only fire when the link click text is ‘Create free AdPage Tagging’.
To see what click text the button you clicked has, go to the session event of that click in preview mode. Click on the ‘Variables’ tab as shown in the screenshot below.
If you scroll through all these variables for that one session event, you can see which ones are linked to that event. In the case of the link click with the click text ‘Create free AdPage Tagging’, we check which click text is used for this button. As you can see in the screenshot below, it’s “Read more”.
Now you know what to change in your trigger for that specific tag to make it fire. And this same process works for all your tags and triggers, not just for link clicks.
Changes made on the site
When you make changes to your site, such as changing your URLs, updating your button and link texts, modifying the purchase process, or updating your DataLayer, you will want to ensure that this does not affect your measurements.
If you open your site in the test environment of preview mode, you can check all your changes and perform the events. Within your preview mode, you can then track which tags are and are not fired.
When tags have not fired that should have, click on the event in the vertical left menu where you expected that tag to fire. Once you have selected that event, you can click on the not-fired tag to see what went wrong with the trigger.
Within that tag, you can then see why the trigger did not work. Based on what went wrong, you can make adjustments to that trigger.
Updated on: 16/08/2024
Thank you!