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. Online Marketing Tools
    4. Google analytics tracking code is wrong?

    Google analytics tracking code is wrong?

    Online Marketing Tools
    4 4 776
    • 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.
    • HMK-NL
      HMK-NL last edited by

      Dear all,

      I see a dip in direct traffic which is quite significant and I wonder if my google analytics tracking code is wrong.

      Which code should I use?:

      A:

      B:

      or

      😄

      1 Reply Last reply Reply Quote 1
      • Martijn_Scheijbeler
        Martijn_Scheijbeler last edited by

        I would go for A or C, but as their is a difference between them you have to choose yourself. C will enable remarketing via Google Analytics remarketing lists as A will just use the default tracking code. I won't use B as this is using the CDATA tags and is also using the setDomainName variable from an older version.

        Btw, the downside of using C however is that a certain percentage of visitors will block this Doubleclick JS which is used in the tracking code due to browser plugins for adblocking.

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

          Hi!

          Go with option A.

          B contains deprecated elements, and C would track everything as the same page in addition to containing errors.

          hope this helps 🙂

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

            Hi there,

            As was already mentioned here, the first one (A) should work ok (that's the updated code given to track a domain and their subdomains). What type of domain structure are you looking to track?

            Thanks!

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Google Search Console linking with Google Analytics
              jacleaves
              jacleaves
              0
              2
              113

            • Tracking AMP / Organic search in Google Analytics
              Joe_Stoffel
              Joe_Stoffel
              1
              2
              1.5k

            • URL changes in Google Analytics and Google Search Tools
              whitewallmarketing
              whitewallmarketing
              0
              4
              109

            • Question on Google analytics
              danatanseo
              danatanseo
              0
              5
              422

            • What is the difference between "Event tracking" and auto-tag event tracking with Google tag manager?
              esiow2013
              esiow2013
              0
              5
              644

            • When I can place the Google Analytics javascript code in my web pages?
              S_Curtis
              S_Curtis
              0
              3
              164

            • What are the best tools to test whether google analytics tracking code is tracking well?
              kchandler
              kchandler
              0
              4
              219

            • In Page Analytics Not Showing For My ASP ImageButtons (Google Analytics)
              Resultify
              Resultify
              0
              2
              1.2k

            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