Setting up GA to report on sub domains
-
I've just launched a mobile version of my site at m.mydomain.com.
I could do with a bit of help just checking I've inserted my Google Analytics code correctly though.
I've chosen the sub domain option from settings and pasted the code into both the mobile and the non-mobile version of my sites.
However, am I right in thinking that the setDomain attribute should point to two different domains for example:
_gaq.push(['_setDomainName', 'm.mydomain.com']); (for the mobile site)
and:
_gaq.push(['_setDomainName', 'mydomain.com']); (for the standard site)
Thanks very much for your help!
-
Hey there, any update on this?
If not, I'll be resolving this question.
-
Sorry!
If you're still not seeing any traffic, it's really hard to say without looking at the code. There's likely something wrong in the formatting, perhaps caused by your mobile CMS. In other words, you might have entered the snippet correctly, but when rendered on-page, something goes awry.
Really difficult to say!
Can you access the page in a regular browser? If so, have you tried the Google Chrome Google Analytics debugger? You can see if the _trackPageview is firing, that way. If you'd like, copy the snippet as it appears on-page (via view source) into a reply and I'll take a look (you can remove your domain and UA-XXXX-X account so as not to reveal anything, if you'd like).
Mike
-
Thanks for the reply Mike. Once I've done that, do I need to amend anything else? I'm only asking as I'm not seeing any hits on my mobile site since implementing the new tracking... Cheers,
-
Nope, the second _setDomainName line should be on both subdomains. That's all that's really required to enable proper subdomain tracking nowadays.
Optionally, you can add the _setIgnoredRef line just before the _trackPageview:
_gaq.push(['_addIgnoredRef', 'mydomain.com']);
-
Just wanted to give this a quick bump - any ideas?
Thanks,
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 Change Post Mortem
Hello, my company changed our domain 2 weeks ago and we are just starting to see traffic level back out, except for Organic. The site is on shopify so it made switching the domain pretty easy, as well as the 301 redirects (no url structure changes). We've taken all the proper steps with google/bing webmaster tools as well as monitoring 404's and 301 testing and don't see any red flags. Does anyone roughly know how long it takes for 301's to re-index and domain authority to start building back up for our new domain? Our old domain was about 13 years old and the new one was parked for quite awhile. p.s. I also noticed a lot of our traffic ending up as referral from our old url. I was able to wipe the sessions from analytics which cut it down, but will this persist for the foreseeable future? Thanks!
Reporting & Analytics | | SchoolhouseElectric0 -
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 -
Hello, our domain authority dropped significantly overnight from 37 to 29\. We have been building good links from high DA pages and producing quality, regular content.
Hello, our domain authority dropped significantly overnight from 37 to 29. We have been building good links from high DA sites and producing regular, good quality content. Anyone able to offer any ideas why? Thanks
Reporting & Analytics | | ProMOZ1231 -
What is this GA URL I keep seeing?
According to google analytics, most of my traffic goes to two URLs: "/site/kempruge" and "/" now, I'm pretty sure both of these are taking people to my homepage, but I do not understand the "/site/kempruge' one at all. When I type www.kempruge.com/site/kemprure it 404's, so I'm not sure what URL it even is? Also, I'm wondering if this url is hurting my website in some way? I attached the screenshots, but they didn't load properly. I'll try to add another one in the replies. Thanks! Ruben [](<a href=)" target="_blank">a>
Reporting & Analytics | | KempRugeLawGroup0 -
Why is Google Analytics reporting 20% fewer goals than Unique pageviews of same thank you page?
This is really puzzling me and my research has not thrown out the answer. I have always understood URL goals to be unique pageviews of the thank you page you are tracking. UPVs and goals should both only be counted once per session... Has anyone else seen this issue? Goals were not set up historically so I wanted to use unique pageviews of the thank you page for year on year comparisons, but 20% is a big difference! Background There are multiple pages to track so goal is set up using Regex There is no mistake in the goal set up (honest!) The goal URLs all match the unique pageview URLs, there are no rogue URLs There has been no change to the site or the tracking set up Data is not being sampled It's a lead gen site in an area where multiple enquiries within one visit would be very unusual Thanks in advance!
Reporting & Analytics | | McCannSEO0 -
Does a Manual Penalty Affect Other Sites in Same GA Account
Hello Mozzers, I was a bit foolish a couple of years back when first getting into the game, and employed a dodgy agency to do some SEO for me on some sites. Fast forward to this year, and the two sites in my Google Analytics account have been hit with a manual penalty. I decided to ditch the websites and move on, so removed them from my GA account, webmaster tools etc and will simply let them die a death. My question is, do you think this would affect how easy it would be to rank other websites within my GA account? Does anybody have any views on this? Thanks!
Reporting & Analytics | | Marc-FIMA0 -
How do I connect GA to SEOMOZ if I do not have access to a GA account ?
I am not the owner of the account it is a clients and I need to connect my SEOMOZ to their GA account.. any ideas? Thanks in advance 🙂
Reporting & Analytics | | Andisue1 -
Tracking Subdomains without access to Primary Domain
Hi, I have look after mutliple sub domains on a website and want to implement GA sub domain tracking across them. I do not have however have access to the primary domain as thats controlled by a larger organisation. I'm wondering how to set this up so it tracks correctly? Do I set the domain name in my property to the primary domain, or the main subdomain? For example I have test1.example.com (which is basically a homepage), test2.example.com, test3.example.com and test4.example.com which are various sections. As stated, I don't control the root example.com so Do I use setdomainname test1.example.com in the tracking code or setdomainname example.com. Apply filters etc and then setup profiles for each subdomain? Hope this makes sense. Thanks.
Reporting & Analytics | | breaktheseal0