Tracking Across 3 Sub-directories on the Same Domain in Google Analytics
-
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.
-
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:
-
GA should naturally track any sub-directories on the same domain without added code. What exactly are you trying to accomplish?
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Changed Domains and Internal Links haven't followed, Old Domain redirects to new domain
On our domain residentiallandlord.com we are a little confused on the Compare Link Profiles option,I'm wondering if you can helpWe changed our domain a few years back and have our old domain redirected to our new domain.On our new domain we have only internal links visible, https://residentiallandlord.com/wp-content/uploads/2018/06/moz-rl.com.pngbut if you look at our old domain, which goes to our new domain it has loads of internal links, even though there is no physical site on this domain as it redirects to our new one, https://residentiallandlord.com/wp-content/uploads/2018/06/moz-rl.co.uk.png Can you help me understand why no internal links are showing for the new domain and how to fix this.
Moz Bar | | karlh19740 -
What do you do when there is significant movement when checking a Ranking & Algorithm tracking tool?
I've checked various Ranking & Algorithm tracking tools (SEMrush, Mozcast etc.) and since 12th Jan 18 there has been a lot of 'turbulence' in terms predicted Google algorithm changes. This has been 'high' for the past 2 weeks. Question is, would you 'hang tight and ride the wave' or 'act fast'? Our actual rankings haven't really been affected positively or negatively - so I'm thinking I should just ride the wave to see what happens but keep a close eye on the rankings?
Moz Bar | | Jack_Jahan1 -
"Keywords Showing" total doesn't match "Tracked Keywords" total
My "Tracked Keywords" total under "Add & Manage Keywords" does not match the total for "Keywords Showing" on the main "Rankings" tab. Why is there a difference? For example, I have 453 tracked keywords attached to my campaign, but under the "Tracked Keywords Overview," there are only 254 listed. I'm sure there's a simple explanation but I can't find it anywhere!
Moz Bar | | MSoleski0 -
Domain Authority Not Updating?
Anyone know why DA hasn't been refreshing? Last one was in August, then it said the next update would be 6th September, then 8th October, 15th October, but nothing, and now 17th November. Nothing too important, just curiousThanks,
Moz Bar | | jamesbox2 -
Any Plans to Add More Complete Inbound Marketing Data (ie conversion tracking) to Moz Analytics?
Anyone know if there are plans to add more complete Inbound Marketing Data (ie conversion tracking) to Moz Analytics? The kind of stuff you find in the excel report demonstrated in the recent Moz Blog post by Aaron Friedman http://moz.com/blog/storytelling-through-data-a-new-inbound-marketing-seo-report-structure
Moz Bar | | RickyShockley0 -
Bing search match vs google
With the keyword research on moz it reports on bing search volume - does anyone know if you should multiply this for google searches - ie if I'm looking at a keyword with 2500 bing searches what should I be considering google would be?
Moz Bar | | Wickedwildweb0 -
Social Analytics: Service that integrates Facebook, Twitter and LinkedIn?
Can anyone recommend a social analytics tool/service that integrates analytics data from Facebook, Twitter and LinkedIn? I'm looking for one place to manage all the data from these individual analytics platforms. So the service would be one where the subscriber would need to provide their account credentials from each platform, and the data would be rolled up into a unified dashboard.Thanks!
Moz Bar | | Allie_Williams0 -
Tracking a domain with multiple locations
Esteemed Marketers of the Moz community, We'd like to track a domain that has a separate web presence for specific locations. In other words, the business has multiple locations in NJ and one in NYC. Any tips and tricks to track how we're doing in the rankings for both NJ and NY? Thanks Much, Paul
Moz Bar | | brainrainmedia1