GA Subdomain Setup
-
Hi Mozzers,
Can someone show me how to add a subdomain profile (sub.example.com) under the master profile (www.example.com) on Google Analytics.
I am not sure on how to set it up.
Thanks
-
Yep, it should be /$A1$B1. Sorry about that!
-
Thanks ... DId you mean to say /$A$B1for Output To -> Constructor
In your comment yesterday you omitted the 1 after the B so I just wanna be sure I got this correct. I put /$A$B1 in my filter.
I very much appreciate the help.
-
Yep. I think that you need to select "Request URI" and then enter /$A$B (which is the same as above, but with a slash before it).
By the way, all of this info came from a great post I found: http://www.bigdaylight.com/analytics/filtering-subdomains-in-google-analytics/. You can also look there and check in the comments for other updates.
-
Thanks so much for the info. Getting everything set up and just want to check with you regarding the dropdowns in filter setup.
In your instructions you wrote -->
6. Field B -> Extract B:
Select “Request URL” from the drop down.
Enter (.*) in the text box.
7. Output to Constructor:
Select “Request URL” from the drop down.Enter $A1$B1 in the text box.
but there isn't a Request URL in the dropdown choices. Only Request URI which I assume is the correct choice since we're talking about filtering URI's and not URL for main domain and subdomain.
Can you verify that choosing 'Request URI' is what you meant to write or let me know if there is a different selection that I should make?
I've attached a screen cap of my dropdown options.
Thanks in advance -- you've been a great help.
-
The picture that you showed tells Google to track the subdomain support.yoursite.com along with www.yoursite.com. However, if you have these two pages:
support.yoursite.com/your-product/
www.yoursite.com/your-product/
They will both be recorded as /your-product/ in the Google Analytics data. The (unfortunately very complicated) filter that I listed earlier is to add /subdomain/ in the folder structure, so that:
support.yoursite.com/your-product/ will be tracked as /support/your-product/
www.yoursite.com/your-product/ will be tracked as /your-product/
Is that a little clearer?
-
-
Hi Kristina,
I created that profile combining the main domain and subdomain but what I don't understand is that never when creating the filter I am inserting the name of this subdomain.
So are you saying that the name of the subdomain is not necessary and GA will still track the subdomain in question?
Thanks
-
The way I recommended originally is to have one profile that has both your main domain and your subdomain mixed together, and the filter that I described would append the subdomain as a /folder/ in the URLs that Google is tracking. The filter should automatically populate that /folder/.
Best,
Kristina
-
Hi Kristina,
Sorry to bother you again but I still have an interrogation regarding the Reg ex you gave me. My concern is that no Reg expression is emphasizing on the subdomain i am trying to track.
I think in order to do that I would have to go under the "profile settings" and insert sub.example.com as the website's URL, right?
thanks
-
Nope, sorry, I wasn't very specific about when you add +New Property. When you're at the highest level, click on the account that you want to add the main domain and subdomain tracking to, and the next level down should have a button that says +New Property.
I believe that you'll have to have two codes on your site, since they're slightly different. If anyone knows a way to just have one code but track on multiple properties, chime in!
-
Thank you for this in depth answer
Did you mean by +new property= +new account
If it is so, my question is: is it ok to have 2 GATC codes on all the pages since you are saying we should a get a new property?
Thanks
Ty
-
Hi Ty,
Google recommends that you keep your original profile for the main site running and create a separate profile for the combined main domain and subdomain tracking, so to get things going, you should:
- Go under "Admin," like you had seen before
- Click +New Property
- Fill out the setup information (name it something that'll remind you that you're combining the main domain and subdomain here
- Then choose select "one domain with multiple subdomains" for the tracking code.
The, yes, you're going to put that code on both the subdomain and the main domain pages.
The filter is to distinguish between the main domain and subdomains while you're in Google Analytics. GA only reports everything after the domain, so if you have two pages, www.main-site.com/page1/ and subdomain.main-site.com/page1/, they're going to be reported as /page1/, and their data will be combined.
http://www.bigdaylight.com/analytics/filtering-subdomains-in-google-analytics/ tells you how to set up a filter to distinguish between the two:
1. Select “Add new Filter for Profile”
2. Filter Name: “Show Full URLs” (or your own description)
3. Filter Type: Custom Filter
4. Select “Advanced”
5. Field A -> Extract A:
Select “Hostname” from the drop down.
Enter (.*) in the text box.
6. Field B -> Extract B:
Select “Request URL” from the drop down.
Enter (.*) in the text box.
7. Output to Constructor:
Select “Request URL” from the drop down.
Enter $A1$B1 in the text box.
8. Field A Required: Yes
Field B Required: No
Override Output Field: Yes
Case Sensitive: NoAfter that, you should be set.
-
Hi Kristina
thanks for the doc. From my understanding:
Step 1: I would go under "admin", then "tracking code", select "one domain with multiple subdomains", then save
Step 2: Copy and paste the new GATC on sub domain to sub.example.com. Should I capy and paste this new GATC under the main domain too?
Step 3: go to "Profile", then click "+new profile" , create a profile
Step4: add a filter but then I am not sure what to do? There is an advanced setting i have to go to as well?
Anything eles i should do too?
Thanks
Ty
-
Hi Taysir,
It's not a simple process, and you're going to have to modify your GA code on your subdomain pages for it to work. Google has the instructions here: https://support.google.com/analytics/bin/answer.py?hl=en&answer=55524.
Let us know if you have problems with any of Google's steps,
Kristina
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
-
Is GA Real-Time Locations Broken?
When I look at my real-time site traffic in GA, I'm seeing a lot of direct traffic from Montvale, NJ. However, when I go to the audience tab for today or any day in the past, Montvale doesn't even show up in the list of cities sending traffic. What am I missing here?
Reporting & Analytics | | jimbeaux_slice2 -
Connect AMP to the same website GA property or not
Hi, Asking this on behalf of a client:"I know Google recommends setting up a separate GA property for AMP which they note in a few places:https://developers.google.com/analytics/devguides/collection/amp-analytics/https://support.google.com/analytics/answer/6343176?hl=en
Reporting & Analytics | | MediaCause
From what we can tell this is because the tracking for AMP will measure things differently than the current analytics.js library. I also think it's related to the GA cookie and how it's set differently for AMP pages.But won't this cause drop-off in user journey information? For example, if a user views an AMP blog article but then clicks to our site from a link within the article. I think we would then track this as two separate users and the pages/visit would be off. I found this article which explains a tech way to connect AMP to the same website GA property but it seems a little too much of a work-around:https://www.simoahava.com/analytics/google-analytics-client-id-amp-pages/ Do you think we should just do what Google recommends and set up AMP as a separate property in GA?" --> Does anyone know if there could be any issues with this workaround?Thanks,0 -
Multiple GA codes, one site.
Hi all, Is anyone running two GA codes on one website successfully? My organisation own a number of websites so we used to have one global GA code on all our sites to track global stats, and then we would also have site unique GA on each property to just track that one property. This worked fine, but of late we seem to be getting no data from the globally based code. Obviously, with the site-specific codes we can enter the name for that domain in GA but for the overall code, it is called 'all.com' I'm wondering if Google has now tied the GA domain to the code or if we are doing something wrong. All the codes are the same as they always were but have stopped working. As a stop gap, we have swapped to using Piwik as the all.com code. However, we are then comparing the stats in two different analytics programs so will get a different result. Also, it would be nice to be able to add the all.com to tools such as this to generate weekly reports. Anyone else having GA woe like this? Thanks. Carl
Reporting & Analytics | | WonkyDog0 -
How do I setup a logged-in vs. non logged-in custom variable in Google Analytics?
I found an example of the snippet to use: __gaq.push(['.setCustomVar,
Reporting & Analytics | | Evan34
1, // first slot
'user-type', // custom variable name
'visitor', // custom variable value
2 // custom variable scope - session-level
]); Once the visitor logs into your website, we change this code, accordingly: __gaq.push(['.setCustomVar,
1, // first slot
'user-type', // custom variable name
'regular-user', // custom variable value
2 // custom variable scope - session-level
]); How does the code know to change from 'visitor' to 'regular user' once a user logs in? Is the snippet only placed on the login page?0 -
Queries vs. Organic Keywords in GA
Could someone explain how the following metrics in Google Analytics are being calculated: Search Engine Optimization (Acquisition): clicks on a certain query Campaigns (Acquisition): sessions on a certain keyword GA Help states that both 'queries' and 'organic keywords' refer to the actual string a user enters in Google Search. In that cases it seems that 'clicks' on a SERP result through a given query and 'sessions' through that very same query could not be miles apart. E.g.: Clicks through query X = 170 Sessions through organic keyword X = 8 Thank you for helping me out!
Reporting & Analytics | | WeAreDigital_BE0 -
Is Analytics Code for SubDomains different?
I am currently tracking site performance on our website with Google Analytics. Recently, we've brought a Wordpress blog into our site as a subdomain blog.accupos.com. Though we did this a few months ago, we do not have Analytics data for these pages within the wordpress platform. I've found where to paste the code, in the Footer block of the Wordpress template, just before the close body tag (is this the best recommended way?) and just have one question about WHICH code to paste. Can I add the original code, same as the rest of the site? Or does Analytics have a different code for tracking subdomains? If so, do I need to replace existing code for the rest of the site? I hope I worded this okay. Please help. I'd appreciate it! Derek M.
Reporting & Analytics | | DerekM880 -
Subdomain and relative link paths cause crawl errors
I have a Wordpress blog on our subdomain and we use relative paths on our domain. It appears as though Google bot is crawling from the subdomain categories back to the domain relative paths. This of course results in hundreds of 404 pages. Any suggestions as to how to resolve this issue without changing the relative path structure of our domain? I can provide more information if need be. While I realize these issues are not that pressing, I'd obviously like to remove as many errors as possible. If anyone has encountered this problem, especially in Wordpress I'd really like to hear your solution or lack there of. Thank you in advance.
Reporting & Analytics | | BethA0 -
I am showing no (not provided) visits in GA. Is that possible?
When reviewing Organic search traffic on my site, there no (not provided) visits. Not one. I searched for the term while viewing all keyword visits and still nothing! I find that hard to believe that is possible with 6,000 monthly visits. Is something wrong? Help?!
Reporting & Analytics | | SignifyMarketing0