How to Use GTM Preview Mode for Debugging Tags Correctly

Learn how to use Google Tag Manager (GTM) Preview Mode to test and debug your tracking setup before publishing changes. This step-by-step guide explains how to check if tags are firing correctly, troubleshoot common issues, and ensure accurate data collection for Google Analytics, Facebook Pixel, and other tools. Perfect for beginners and experts alike! 🚀

3/12/20254 min read

Set up GTM
Set up GTM

How to Use GTM Preview Mode for Debugging Tags Correctly

Introduction

If you use Google Tag Manager (GTM) to track user actions on your website, you need to make sure your tracking works correctly. Sometimes, a tag might not fire, or data might not be sent to Google Analytics.

This is where GTM Preview Mode comes in. Preview Mode helps you test and debug your tags before publishing them live.

In this guide, we will explain how to use GTM Preview Mode step by step in simple words, like explaining to a 10-year-old.

What is GTM Preview Mode?

Preview Mode in Google Tag Manager allows you to see which tags are firing and which ones are not.

Example: Preview Mode is Like a School Test

Imagine you are preparing for a school test. You complete a practice test before the real exam to check if you understand the subject.

Preview Mode works the same way. It lets you test your GTM setup before it goes live.

Why is Preview Mode Important?

  1. Check if tags are firing correctly

  2. Verify if triggers are working as expected

  3. See what data is sent to Google Analytics, Facebook Pixel, or other tools

  4. Fix errors before making changes live

Without Preview Mode, you might not know if tracking is working properly, and you could lose important data.

How to Use GTM Preview Mode

Step 1: Open Google Tag Manager

  1. Go to tagmanager.google.com.

  2. Select your GTM container.

  3. Click the "Preview" button at the top right.

This will open Google Tag Assistant, which helps you test your GTM setup.

Step 2: Connect Your Website

  1. In the Preview Mode window, enter your website URL.

  2. Click "Connect".

  3. Your website will open in a new tab, and the Google Tag Assistant panel will appear at the bottom.

This panel shows:

  • Which tags are firing

  • Which triggers activated the tags

  • If any tags failed to fire

Step 3: Perform Actions on Your Website

To test if tracking is working, perform actions on your site that should trigger a tag.

Example: Testing a Click Tracking Tag

Imagine you set up a tag to track button clicks.

  1. Click the button on your website.

  2. Go back to Google Tag Assistant.

  3. Look for an event like "Click" in the left panel.

  4. Click on it and check if your tag fired.

If the tag fired, your tracking is working correctly. If not, there is an issue.

Step 4: Check the Data Sent by the Tag

When a tag fires, it sends data to Google Analytics or other tracking tools.

To check the data:

  1. In Google Tag Assistant, click on a tag that fired.

  2. Look at the variables and values it sent.

Example: Checking a Purchase Event

If you have an e-commerce website, you may track purchases.

  1. Make a test purchase.

  2. In Google Tag Assistant, check if the Purchase tag fired.

  3. Click on the tag to see what data was sent, such as:

    • Transaction ID

    • Order value

    • Products purchased

If the data looks correct, your tag is set up properly. If something is missing, you may need to adjust your settings.

Step 5: Fix Any Issues

If a tag does not fire, check these common problems:

  1. Wrong trigger settings

    • Example: If a click tracking tag is not working, the button selector might be incorrect.

  2. Tag configuration errors

    • Example: If your *Google Analytics tag is not firing, make sure the correct Measurement ID is used.

  3. Blocked by browser settings or ad blockers

    • Example: Some browsers or extensions may block tracking. Try testing in an Incognito window.

Debugging Tags in Server-Side GTM

If you use Server-Side Google Tag Manager (GTM), debugging is slightly different.

How to Use Preview Mode in Server GTM

  1. Open Google Tag Manager.

  2. Select your Server GTM container.

  3. Click "Preview" and enter your website URL.

  4. Perform an action, like a purchase or form submission.

  5. Check the Server GTM Debug Panel to see if the event was received.

If data does not appear in Server GTM, there may be an issue with how the website sends data to the server.

Common GTM Preview Mode Errors and Fixes

Issue 1: GTM Preview Mode is Not Connecting

Possible Reasons:

  • Your website is blocking Google Tag Assistant.

  • Your browser has third-party cookies disabled.

  • You entered the wrong website URL.

Fix:

  • Try opening your website in Incognito Mode.

  • Enable third-party cookies in your browser settings.

  • Make sure you entered the correct website URL.

Issue 2: Tag is Not Firing

Possible Reasons:

  • The trigger conditions are incorrect.

  • The tag is set to fire on the wrong page.

  • There is an error in the tag settings.

Fix:

  • Check the trigger settings to make sure they match the correct action.

  • Use Preview Mode to see if the tag is being blocked.

  • Test different actions to see when the tag fires.

Issue 3: Wrong Data is Being Sent

Possible Reasons:

  • The wrong variable is being used in the tag settings.

  • Some data is not available on the page.

Fix:

  • Check the variables in Preview Mode to see if they contain the correct values.

  • Make sure the website properly sends data to GTM.

Final Thoughts

GTM Preview Mode is a powerful tool to test and debug your tracking setup before making changes live.

  • It helps you check if tags fire correctly.

  • You can see what data is sent to tracking tools.

  • It allows you to fix errors before they affect your website analytics.

By following this guide, you can debug your GTM setup quickly and ensure your tracking works perfectly.

Would you like help setting up server-side tracking?

Get in touch with us:

Email: connect@ecommidea.com

WhatsApp: wa.me/919839618999