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
-
Domain Analysis Limit
Hello, even though we are a Moz Pro user we have a 'part-timer' who keeps the client metrics scoreboard up to date. Rather than have him running wild in Moz Pro we bookmarked the 'Domain Analysis' page and he knows that only 3 can be reported on per day. If it was an immediate need then we would use Moz-Pro. The issue was reported to me that he is receiving 'Search Limit reached' and do a moz-pro trial. So, has the 3 per day limit been changed? Thanks, Dave
Moz Bar | | 7thPowerInc0 -
New Domain Authority 2.0 have affected my website rankings badly
My website https://www.successvalley.tech/ domain authority was 39 but after the new update, its now 15. Am not happy at all because it took me three years to get that and now it has been reduce to nothing. Please I kindly need explanation as to what happened. Thanks
Moz Bar | | Amenorhu1 -
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 -
Is the Moz on-page grader going to start grading mobile-first as Google does?
I wonder whether this has been taken into account yet or there are any plans to in future.
Moz Bar | | mybuilder1 -
Is there anyway to track on-page grader grades for a site?
As opposed to going through the process of inputting the urls and keywords every couple of weeks, is there a way of Moz to send the scores for those keywords and the domain to which the url belongs?
Moz Bar | | DigitalGuru0 -
Keyword Difficulty tool showing Google search volume or Bing?
Hi, I plugged in a bunch of keywords to know their search volume, chose Google from the drop down and then chose English from the next dropdown and clicked on Check dificulty. It shoes me "Bing Search Volume (Exact Match)" on top but shows the name of the keyword and "for Google CA" on the left. Is the search volume for Google? or Bing? and the difficulty as well? Google or Bing? "
Moz Bar | | SpaMedica0 -
Ww.domain.com coming up with error
our domain is showing in moz with the following error in crawl reports Crawl Error We were unable to access your homepage, which prevented us from crawling the rest of your site. It is likely that other browsers as well as search engines may encounter this problem and abort their sessions. This could be a temporary outage, but we recommend making sure your network and server are working correctly. note that the url being displayed is ww.domain.com and not www.domain.com . we do not have a 301 in place, we have switched off wildcard forwarding from the server.. its acting as the url is a subdomain that is not working.. should i just ignore it?
Moz Bar | | Direct_Ram0 -
I already have a campaign registered in moz, but it does not appear when I open Moz Analytics, as I proceed?
I received an email suggesting you upgrade to Moz Analytics, however to do the procedure my existing campaign stopped appearing and I can not access it, how should I proceed?I need back to Pro?
Moz Bar | | IBacana0