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. Other Research Tools
    4. Tracking Across 3 Sub-directories on the Same Domain in Google Analytics

    Tracking Across 3 Sub-directories on the Same Domain in Google Analytics

    Other Research Tools
    3 3 228
    • 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.
    • vndflkvnlkzdfnv
      vndflkvnlkzdfnv last edited by

      Hello everyone,

      I'm trying to track 3 sub-directories on the same domain.

      http://domain.com/1/http://domain.com/2/
      http://domain.com/3/

      Could someone help confirm this is the correct code for GA?

      var pageTracker = _gat._getTracker("UA-12345-1"); pageTracker.**_setCookiePath**("/1/"); pageTracker._trackPageview(); pageTracker.**_cookiePathCopy**("/2/"); pageTracker._trackPageview(); pageTracker.**_cookiePathCopy**("/3/");
      

      Thanks in advance.

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

        GA should naturally track any sub-directories on the same domain without added code. What exactly are you trying to accomplish?

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

          You do not need to use any special code like that, all you need to do is make sure that the basic Google Analytics code is located on all pages on your site.  The one thing I do recommend doing is updating to use Google's newest tracking code, which should look like this:

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • In Moz Campaigns, how are competitor domains tracked if they redirect their site?
            dave.kudera
            dave.kudera
            0
            2
            30

          • Changed Domains and Internal Links haven't followed, Old Domain redirects to new domain
            karlh1974
            karlh1974
            0
            3
            63

          • Why My Website DA decreased as the no of domain catches in google webmaster?
            Clotaire-Damy
            Clotaire-Damy
            0
            5
            231

          • I have 3 domains with deffrent TLD and convert them to .com domaim why spam score show 9/17 for them
            Andy.Drinkwater
            Andy.Drinkwater
            0
            3
            125

          • Should I exclude prepositions in tracked keywords of moz analytics?
            LauraSultan
            LauraSultan
            1
            3
            1.7k

          • Any Plans to Add More Complete Inbound Marketing Data (ie conversion tracking) to Moz Analytics?
            jon.white
            jon.white
            0
            2
            115

          • Why does Moz Analytics drop my Google Analytics connection every time I login?
            cbizzle
            cbizzle
            0
            7
            192

          • Moz Analytics only working with Google Analytics?
            Xilopix
            Xilopix
            0
            3
            156

          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