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
-
Will Removing or Disavowing Toxic Links Improve MOZ Domain Authority?
The vast majority of the 140 domains that link to our website are very low quality directories or and other toxic links. Only about 20-30 domains are not toxic (according to Link Research Tools confirmed by out manual inspection of these links). Would removing some of these links improve of MOZ Domain Rank? What if we cannot remove them, can NOZ detect a disavow file? In general would improving the ratio between good quality and poor quality links improve domain authority? Thanks,
Moz Bar | | Kingalan1
Alan2 -
Is it possible to find every reference to my company name across the internet?
I am trying to find every single website that mentions my company name (attempting to identify some negative posts.) It is a rather unique name but I suppose that kind of search would be difficult. Any ideas?
Moz Bar | | pcthrpy0 -
How accurate is Moz Rank Tracker tool? It's showing different results than a Google incognito search.
I have a keyword/url combo with Moz Rank Tracker showing 3 spots above what a Google Incognito search showed. I performed my Google Incognito search based on these suggestions: https://moz.com/community/q/best-and-easiest-google-depersonalization-method Is the Moz Rank Tracker tool off?
Moz Bar | | chiefmoz1 -
Has Google officially dropped the mobile-friendly label?
I noticed in my keyword ranking reports that the heading "Google en-US Mobile Friendly" indicates false for all tracked keywords... Is this information still helpful in the reports? _Cindy
Moz Bar | | cceebar0 -
Puzzled. High domain authority, but low page authority?
I have a question regarding how a page's authority can be low but the domain authority be high. I'm using the SERP report in moz to compare competing pages. The page I'm working on is an ecommerce category page. Moz says it has very low page authority, has been indexed for a little over a year, it's domain authority is a moderate 50, and has no root domains linking to it. It is more relevant than the other pages (has more products for sale that fit the keyword searched for), has a decent amount of copy on the page, but ranks around #10 in the search results. The competing pages are also ecommerce category pages. The 9 ranking higher have domain authority varying from 30-75, and 1 or 2 root domain links to them. Their number of products that match the keyword searched are all over the board, some have many matches, some have only 6 or 8 results. Some have a moderate amount of text on the page, some have very little text on the page. Yet they have page authority in the 30s-40s. What goes into page authority that I'm missing which would make these other pages have so much more authority when they are just slightly better in the other metrics listed above? What am I missing here?
Moz Bar | | K-WINTER0 -
Can we access previous weeks/months key word analytic stats?
We're missing some data for our key word positioning from November and December of last year and I am looking to see if I can access this still? I realise i can access the previous weeks stats and also a month as a whole but is it possible to access previous weeks or months and how can i go about doing this? Thank you!
Moz Bar | | collection_260 -
Is it normal for my homepage's page authority to be higher than my domain authority?
Hi everyone, I've just been checking my MOZ authority scores, and the page authority of my home page, www.concerthotels.com is 53 (mozRank of 6.16) which seems pretty good to me. However, the domain authority is only showing as 45. Is this typical? There is such a big difference between these two scores - what does that suggest? Is there anything obvious that I can do to bring the domain authority up to the level of authority that the homepage commands? Similarly, the UK version of my site has a homepage authority of 41, but the domain authority is only 30. Looking at numerous other websites, quite often the homepage and domain authority scores are very similar, or the domain authority is slightly higher, so it does look as if this is unusual. Any comments would be greatly appreciated, Many thanks Mike
Moz Bar | | mjk260 -
Competition tracking
Hello when I added my website, I was asked to add competition website and brand name, where can I track this now?? Or If i cant track it, why was I asked to put it and how can it help? Sorry for asking, I use tablet at the moment and I just can't find it. Thank you, matt
Moz Bar | | Faild0