DEV Community

Cover image for How to Check if Google Tag Manager is Working?
Bhavesh Patel
Bhavesh Patel

Posted on

How to Check if Google Tag Manager is Working?

Google Tag Manager (GTM) is a tag management system that allows you to quickly and easily implement tracking tags, marketing pixels, and snippets of code onto your website or mobile app. Having GTM makes it easy to add, update or remove tags without needing to edit code.

It's critical to verify that GTM has been installed correctly and that tags are firing as expected. A broken GTM implementation means you'll miss out on collecting important user data and analytics.

Why is Verifying Google Tag Manager Important?

Ensuring that GTM is working correctly is crucial for tracking accurate data. If GTM isn't functioning as expected, it can lead to:

  • Incorrect Analytics Data: You may miss critical user behavior insights.
  • Broken Conversion Tracking: Marketing campaigns could be ineffective without proper tracking.
  • Tag Firing Issues: Essential third-party tags might not load, affecting your digital marketing performance.

Methods to Check if Google Tag Manager is Working

Method 1. Use the GTM Preview Mode

Preview Mode is the easiest way to test if GTM is working. Here’s how:

  • Log into Google Tag Manager and select your container.
  • Click the “Preview” button in the top-right corner.
  • A new tab opens where you enter your website's URL.
  • Click “Start” to open your site with the GTM Debug Panel.

You’ll see a Debug Console at the bottom of your screen, listing all tags fired, any errors, and the data layer information. If your tags appear in this panel, your GTM is working correctly.

Method 2. Check the Source Code

The first method to verify GTM is by examining the website’s source code. Here’s how you can do it:

  • Open your website in a web browser.
  • Right-click on any page and select "View Page Source" or press Ctrl+U.
  • Look for the GTM script. It should appear near the top and look like this:
<!-- Google Tag Manager -->  
<script>(function(w,d,s,l,i)...</script>  
<!-- End Google Tag Manager -->
Enter fullscreen mode Exit fullscreen mode
  • Ensure the GTM ID (e.g., GTM-XXXXXX) matches the one in your GTM account.

Method 3. Use Google Tag Assistant

Google Tag Assistant is a free Chrome extension that helps verify GTM and other tags. Here’s how to use it:

  • Download and install Google Tag Assistant from the Chrome Web Store.
  • Navigate to your website and click the Tag Assistant icon.
  • Enable Tag Assistant and reload your website.
  • Look for a green indicator showing “Tags are working correctly.”
  1. Blue: Minor issues.
  2. Yellow/Red: Problems that need fixing.

Method 4. Monitor Network Requests in Developer Tools

For a more detailed inspection, you can use your browser's developer tools:

  • Open Developer Tools: Right-click on your webpage and select Inspect or press Ctrl + Shift + I (Windows) or Cmd + Option + I (Mac).
  • Check the Network Tab: Navigate to the Network tab and filter by "GTM."
  • Look for GTM Requests: If GTM is working, you will see requests like gtm.js and dataLayer being loaded.

Method 5. Use Real-Time Google Analytics Reports

You can also verify GTM via Google Analytics (GA):

  • Ensure your GA tag is set up in GTM.
  • Open Google Analytics and navigate to Real-Time > Overview.
  • Visit your website in a separate tab.
  • If your visit is tracked in real-time, your GTM and GA tags are working correctly.

Method 6. Check DataLayer for GTM Activation

Google Tag Manager uses a dataLayer object to manage information transfer. Here’s how to verify:

  • Inspect the Page: Use browser developer tools to inspect the page.
  • Search for dataLayer: Look for any JavaScript entries labeled dataLayer.push.
  • Validate Entries: Confirm that values are being correctly pushed to the dataLayer, ensuring your tags can read the data.

Common Issues and Troubleshooting

Tag Not Firing

  • Ensure the GTM container ID in the script matches your GTM account.
  • Check for JavaScript errors in the browser console that might prevent GTM from loading.

Multiple GTM Instances

  • Verify there aren’t multiple instances of GTM installed. This can cause conflicts and incorrect data collection.

Incorrect Trigger Configuration

  • Double-check your triggers and ensure they are configured to fire under the correct conditions.

Conflict with Other Scripts

  • Use browser tools to identify script errors and debug them one at a time.

Final Thoughts

Knowing how to check if Google Tag Manager is working is crucial for ensuring your website’s data tracking is accurate. By leveraging tools like Google Tag Assistant, browser developer tools, and Preview Mode, you can quickly diagnose and fix any issues. Proper GTM setup ensures seamless integration of your analytics and marketing tools, giving you the confidence to make data-driven decisions.

Top comments (0)