The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Web Design
    4. Google Tag Manager

    Google Tag Manager

    Web Design
    3 2 918
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ChristopherGlaeser
      ChristopherGlaeser last edited by

      I recently discovered the Google Tag Manager and I am in the process of updating many of my websites with this feature.  I am using Tag Manager to mange Google Analytics, Google Remarketing, Alive Chat, Woopra, etc.  I have one question about how Tag Manager actually works.

      As best I can tell, the Tag Manager code snippet that I insert into my web pages is the same for all my websites and does not include a unique ID.  If that is the case, then Tag Manager must search all the URLs in the TM database to find a match.  What is to stop someone else from adding some rules for my URLs to their containers?  I expect Google has a method to ensure proper matching, but I'm not clear on how that is enforced.

      Best,
      Christopher

      1 Reply Last reply Reply Quote 0
      • ThompsonPaul
        ThompsonPaul last edited by

        There is a unique ID embedded in your Tag Manager code, Christopher. It's specific and different for each container you create for each site (i.e. each container has a different ID). So the Tag Manager code on your pages is calling rules from your specific container. Nobody else's rules could affect your account unless you let them add their snippet to your site.

        Here's an example of the Tag Manager snippet showing the unique ID In this case anonymized to GTM-XXXX:

        
        <noscript><iframe src="//www.googletagmanager.com/ns.html?id=<strong>GTM-XXXX</strong>"<br />height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
        
        

        This is assuming, of course that you've followed the best practices of creating a new container for each website. If you're using cross-domain tracking or rollup reporting, I suppose to might be possible to implement all within one container even for multiple sites.

        All that said - there's nothing to stop another website from maliciously adding your Analytics code to their own website (whether through Tag Manager or regular manual methods) to mess up your stats. The way to avoid this (and best practice for any site) is to ensure you have a hostname filter to remove all GA calls except those from your own approved hostnames. This also helps filter out "accidental" cases like where somebody has scraped your page contents including your GA code. You'd be surprised how often this happens.

        Paul

        ChristopherGlaeser 1 Reply Last reply Reply Quote 1
        • ChristopherGlaeser
          ChristopherGlaeser @ThompsonPaul last edited by

          You're right, the codes are unique.  They are so small (4 characters) I did not recognize them as unique IDs.

          Thanks for the info on the hostname filter as well.

          Best,
          Christopher

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • No cache meta tags - does it help Google get back and reindex faster?
            Ray-pp
            Ray-pp
            0
            2
            1.2k

          • Google tag manager on blocked beta site - will it phone home to Google and cause site to get indexed?
            Nobody1596916721222
            Nobody1596916721222
            0
            4
            234

          • Title Tag Suggestion
            crackingmedia
            crackingmedia
            0
            7
            746

          • Other tags inside an H1 tag
            jonmifsud
            jonmifsud
            1
            4
            32.6k

          • Getting ranked on google
            skehoe
            skehoe
            0
            8
            396

          • How important are tags on blogs?
            csmm
            csmm
            0
            3
            353

          • Does Google follow links inside a <noscript>tag?</noscript>
            Carson-Ward
            Carson-Ward
            0
            5
            3.0k

          • Missing Meta Description Tag - Wordpress Tag
            jonnyholt
            jonnyholt
            0
            6
            6.0k

          Get started with Moz Pro!

          Unlock the power of advanced SEO tools and data-driven insights.

          Start my free trial
          Products
          • Moz Pro
          • Moz Local
          • Moz API
          • Moz Data
          • STAT
          • Product Updates
          Moz Solutions
          • SMB Solutions
          • Agency Solutions
          • Enterprise Solutions
          • Digital Marketers
          Free SEO Tools
          • Domain Authority Checker
          • Link Explorer
          • Keyword Explorer
          • Competitive Research
          • Brand Authority Checker
          • Local Citation Checker
          • MozBar Extension
          • MozCast
          Resources
          • Blog
          • SEO Learning Center
          • Help Hub
          • Beginner's Guide to SEO
          • How-to Guides
          • Moz Academy
          • API Docs
          About Moz
          • About
          • Team
          • Careers
          • Contact
          Why Moz
          • Case Studies
          • Testimonials
          Get Involved
          • Become an Affiliate
          • MozCon
          • Webinars
          • Practical Marketer Series
          • MozPod
          Connect with us

          Contact the Help team

          Join our newsletter
          Moz logo
          © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy