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
-
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 -
Re-connect Goggle Analytics to Moz
I lost the GA account connection to my moz campaign account. I am re-connecting now but on the traffic settings, when I am about to disconnect, I get a warning that I will lose the historical data, what is the impact of loosing this data for the campaign? Thank you
Moz Bar | | RaquelSaiz0 -
Domain authority for .melbourne
Hi there, We have been working on http://www.roofrestoration.melbourne/ for over 2 years now and the domain authority has not moved at all. Is this an issue with the .melbourne domain or is there a more underlining issue? Thanks for the help! Joel
Moz Bar | | JoelMolloy0 -
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 -
Has using Moz got me banned from Google search?
Dear fellow Mozzers, For the last couple of weeks when ever I do a google search I have to enter a captcha code. Now I hardly use google anymore which is annoying ! Then I went onto support.google.com and saw this: https://support.google.com/websearch/answer/86640?hl=en&ref_topic=3378866 "Automated traffic includes: Sending searches from a robot, computer program, automated service, or search scraper Using software that sends searches to Google to see how a website or webpage ranks on Google" Is Moz alone doing this? Thanks in advance for your response. Ash
Moz Bar | | -Ash-0 -
Domain Authority Score Changes
Hi All, I hope you guys are doing great. I need assistance with benchmarking drop that measures domain authority score changes, maybe within 3 months to a year. Is there any reliable tool that we can use for us to see the changes in DA over the past months or years? Thanks, Francis
Moz Bar | | TWS20 -
My product pages have no weight / links from root domains with the Moz tool bar
Hi, When I view my home page (http://www.arkwildlife.co.uk) with the Moz toolbar, I see a good PA and a good amount of links from root domains. As I go down the site, it seems to get worse. The category pages (http://www.arkwildlife.co.uk/Category/0/Straight_Foods.html) have a little but not much and then from this point onwards, it's nothing. The product page (http://www.arkwildlife.co.uk/Item/Straight_Foods~Sunflower_Seeds/SUNH/Premium_Sunflower_Hearts.html) is reporting to have no root domain links but I am not sure why. Interestingly, when I click through to a review page (http://www.arkwildlife.co.uk/StockReview/0/SUNH/0/Premium_Sunflower_Hearts.html) it does have some juice. Would anyone be able help on why this is happening and what I need to be looking at in order to resolve it please? EDIT: I've been looking at the hyperlinks and notice something odd. If I review the score with the first link below, it gives a score of 1, but the second gives a PA of 13 with one root domain linked. 1:http://www.arkwildlife.co.uk/Item/Straight_Foods~Sunflower_Seeds/SUNH/Premium_Sunflower_Hearts.html 2:http://www.arkwildlife.co.uk/Item/Straight_Foods%7ESunflower_Seeds/SUNH/Premium_Sunflower_Hearts.html Please note the "%7E" instead of the "~" in the URL. The browser appears to show the ~ character no matter what but the rank of the page changes. I don't understand what the Moz toolbar is doing with this. Note: This behaviour only happens in Mozilla Firefox, in chrome both the rankings are zero for each URL. Many Thanks.
Moz Bar | | nawgie0 -
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