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
-
Keyword Explorer - root domain (NEW): Domains outside US & Canada - no or no meaningful results
Basically I really like and would love to use the new root domain feature in the Keyword Explorer in my daily work. I usually deal with small to medium sized sites in Switzerland. Looking these up unfortunately it either gives me back nonsense (i.e. keywords that merely have nothing to do with the site; sites are very well keyword optimized) or no data ("There are no results for your search") at all. Is this going to change in the future (...honestly) or its simply due to the fact that MOZ focuses primarily on US & Canada and maybe huge sites in Europe? Thanks for your input. Cheers, Cesare
Moz Bar | | Cesare.Marchetti0 -
How do I disallow crawl on a directory when it's a prefix to my site's URL?
I am trying to disallow our media repository (hosted elsewhere, but appears as a directory on our site) from being crawled by robots but it is not a subdirectory of the site, it's a prefix. So I need to disallow: mediabank.mywebsite.org Not: mysite.org/mediabank What would I need to put in my robots.txt and/or the other host's robots.txt to make this happen? Thanks!
Moz Bar | | Simon-Plan0 -
KW Explorer is Working to Disambiguate Keywords Google Merges Together
Hey gang, Russ Jones from Moz has been doing a ton of heavy lifting work to try to get around the new problem posed by Google AdWords recent change to merged-keyword volume data. But, we're fighting back against this obfuscation in Keyword Explorer. I'm sharing two emails (slightly edited) from Russ about what we're doing here: Introduction to the Problem: Google Adwords Keyword Planner is the primary source for keyword search volume (how often a keyword is searched monthly on Google) for much of the search marketing industry. While Google has grouped together highly-similar terms for a while (especially misspellings), in June of 2016 they dramatically increased this keyword-grouping. This means similar phrases like "keyword rank", "keyword ranking" and "keyword rankings" would all be reported as having the same, combined search volume, rather than their individual search volumes. If you were to take Google's numbers at face value, you might think there are 3,000 searches per month for these 3 terms, when in reality there is only 1,000, divided amongst the 3 terms. How we are addressing it: Moz's Keyword Explorer uses a blend of data sources, not just Keyword Planner, to build our volume metrics. This gives us a distinct advantage in that we can adjust the volume of words that deviate dramatically in one data set verses another. Take for example the phrases "keyword rank", "keyword ranking", and "keyword rankings". While Google Keyword Planner might report all of these as having 1,000 searches per month, Moz Keyword Explorer can detect that these numbers are significantly higher than what our models would predict given our other data sets. We can then adjust the volume accordingly. Moreover, given our huge keyword data set, we can also identify grouped phrases (like these 3) and divide the volume proportionally to what we see in our other data sets. Thus, we address the grouping problem from multiple directions. Here's email #2 from Russ, detailing more of how we're attacking this: I have been working pretty much non-stop on this keyword volume disambiguation problem (finding the real search volume of individual keywords when Google clumps several together). I think I have settled on a pretty good solution and am working on getting it all in. For example... Google Keyword Volume for the phrases "briefcase for women" and "briefcases for women" are both at 3600 because they have been lumped together. My disambiguation script says the singular (briefcase for women) should be 2731 and the plural should be 869. Google Trends roughly agrees with this, showing that the singular is searched more than 2x the plural: https://www.google.com/trends/explore#q=briefcase%20for%20women%2C%20briefcases%20for%20women&cmpt=q&tz=Etc%2FGMT%2B4 Basically, Keyword Explorer should already be providing some more accurate/segmented numbers than AdWords, and in the future, we'll get even better thanks to our clickstream data and our evolving models. Any questions, let us know!
Moz Bar | | randfish15 -
National or local tracking of keywords
I manage an account with +20 locations and have used the default National tracking on keywords, but realized that we might see higher rankings if I choose local tracking. If any of you have any experience in this, please tell the world!
Moz Bar | | peterpumkineater0 -
Domain.com isn't recognized by on-page-grader, but domain.com/index.php is
I am running a website through On-page-grader, as www.domain.com and scores an "F" for a specific keyword. When it's ran as www.domain.com/index.php, it scores an "A" for that same keyword and has everything checked other than "keyword in the domain name". There are no other files such as index.htm, or index.html that would interfere and can't figure out why this page is not being recognized. I checked, the robots and .htaccess file, but do not see anything that would hinder. Could this be a server issue?
Moz Bar | | werkbot0 -
Why does Moz uses the Bing search volume instead of Google?
If i want to check search volume of a key word its done in Bing, but i would like to know the Google search volume for my customers. How do you change this?? Anybody ??
Moz Bar | | Boo5t_Marketing0 -
How to bulk check the ranking for more than 800 domains?
I got a list of 800 domains that my company owns and I want to check every domain for it's SEO value. Some of these domains where never used, but I don't know which weren't used... Do you know a tool for this? Something where I can upload the list in excel?
Moz Bar | | Becki1230 -
Can we export branded reports from Moz Analytics Beta yet?
Hey guys, Just looking around the new Moz-alytics (droooool) and it is superb, but are we able to export and build reports from it yet? Or is this something that will be in the final release? Apologies if this has already been asked. Regards! Joe Sturgess
Moz Bar | | Sturge
Twitter: @Sturge871