Multi-domain setup on Google Analytics - google-analytics

We have a dozen or so sites, as well as the occasional subdomains so:
example.com
example.co.uk
us.example.com
etc
We have been using separate GA codes for each site. This works fine, but it means that adding a new site means getting a new code and we can't tell overall stats (e.g. how many people have visited all sites etc). If we went the one code route and set up separate profiles for each domain/subdomain:
1) Should we use _setDomainName("none") or _setDomainName("www.example.com") and _setDomainName("www.example.co.uk") etc
2) Will each domain profile treat the other domains as separate (e.g. will we tell on example.co.uk how many people visited from example.com and completed goals etc)
3) Are there any disadvantages to this method.

This post from the Google Analytics blog details how to set up a GA account for each site, and an overall 'rollup' account which sits on top - this will let you give separate GA admin control for each site, where you can dig deep into each site's account, and show cross-site referrals, and the rollup will give overall numbers (but I don't think it's going to report on unique visitors across the collection of sites).
http://analytics.blogspot.com/2009/09/advanced-structure-your-account-with.html

Related

Google Analytics: How can I see the referral of a referral?

We have two sites: site A and site B. We manage both.
Site A allows the user to prepare an order which then gets POSTed to site B via a form.
When looking at the GA statistics for site B, I want to be able to see the referral source to site A instead of seeing site A as the referral. How can this be achieved?
Is adding site A to the Referral Exclusion list of site B sufficient? Or do I need to do more than that?
If these are two different GA properties then adding to the referral exclusion list will simply mean that the referring domain appears as direct traffic.
To get the campaign info from the referring domain you would need to set up cross-domain tracking between the two domains.
As an alternative you could store the original traffic source e.g. in a cookie and append it via campaign parameters to all links that go to your other domain. However this would be a lot of work and quite error prone.

Can I use Google Tag Manager to collect analytics from mulitple domains?

The set-up:
1 site, 2 domains: = mysite.com and mysite.co.uk
These 2 domains use DNS to point to the same site (IP).
There is 1 snippet of Google Tag Manager (GTM) code just after the opening <body> tag of the site (every page).
In the GTM container, I have added both domains on the "Container Settings" page.
There is one Google Analytics (GA) account which only contains the .co.uk domain. (An analytics account can only contain 1 domain.)
A tag has been set up in GTM with the type of Google Analytics and it has the UA code from the 1 GA account added.
A rule has been added to fire on all pages
Now, I don't care whether someone visits via .com or .co.uk, but I want to capture combined analytics for both. My questions is, with the way I've set things up using GTM, will GA save data for both domains ie mysite.com and mysite.co.uk, or do I need to set things up another way to achieve this? Ideally, I don't want to go down the forwarding route i.e. forward all traffic from .com to .co.uk.
First a bit of pedantry: Google Tag Manager cannot even collect informatiom from a single domain (it's not a tracking tool). And while you can only enter one domain in Google Analytics that domain setting serves no actual purpose; a Google Analytics account can track multiple domains in different "properties" (porperties are sections in an account that each have a unique id) or in a single property via cross domain tracking. Cross Domain tracking is used if you want to treat multiple domains as a single presence on the web (i.e. if you have a website and a shop with different domains, they still belong together).
Now, the way you have set things up data will be collected from both domains. There are at least two caveats:
1) If users can switch between domains inside a session (go from .com to .co.uk and back) their sessions will be interrupted and Google Analytics will register multiple visitors (that's because users are tracked via cookies which are domain specific). To avoid that you'd need to set up cross domain tracking (and how you would do that depends on if you are using Universal Analytics or asynchronous code. Look at your tracking code, if it contains a line that starts "ga("send"...." your are using analytics. If it contains lines that start with _gaq.push you use asynchronous code).
Cross domain tracking documentation for UNiversal Analytics (analytics.js)
Cross domain tracking for asynchronous code (ga.js)
2) By default Google Analytics tracks only the path, not the domain. If pages on both domains have the same path they will be displayed in aggregated form in the reports, that is if you have an index.php on both pages the visits for both will be added up. Maybe that's just fine with you, if they show the same content in any case. Else you'd either have to use "hostname" as a second dimension (which is not a sticky setting, you would need to re-apply that every time you switch to another report), or you create a filter on your view that includes the hostname in the reports.
Those caveats are relevant because data will show up in any case and will look perfectly okay even if it's not (even if you decide that those two things do not bother you you need to take them into account when you interpret the data).

Track multiple subdomains + tld Google Analytics

** tld = top level domain
I am wanting to track my main domain and all of its subdomains (around 180) in Google Analytics.
I am wondering if it would be better to create 180+ profiles for each subdomain or would it be better to track them all through one profile?
The reason I ask is:
I need to easily access subdomain stats + the total amount of unique visitors PER subdomain
Want to see the total amount of unique visitors (including subdomains and tld)
Any ideas?
usually the best practice with multiple subdomains is really to create a separate profile for each subdomain within a central UA.
Unfortunatelly, there is still a limit of 50 profiles, but if you have such an necessity, you can make contact with any of Google´s Partners and they can submit a request to increase your limit to 200.
Another solution, not as optimal as having many profiles, would be to create virtual pageviews that could id the subdomain and then apply advanced filters to segment the data.
Here at dp6 we are a certified parter, if you would like to contact us, please feel free to do so.

Google Analytics - site with 2 domains, how to track each domain individually?

I have a website with 2 domains. I am trying to track the domains separately. I have both domains inside the same GA account - each domain has a filter applied to it to exclude the other's domain (both with and without the www). It looks like the domains are still being tracked together. How would I go about separating these 2 for different results?
Thanks!
What you're doing now is sending all the traffic to one account (say, UA-XXXX-1), and then using filters to separate them out. This is an imperfect solution, since filters have odd session-related quirks that make them less than ideal for tracking completely separate domains.
To completely separate the results, you need to create separate new web properties within your Google Analytics accounts , so that instead of tracking the second domain on UA-XXXX-1 and filtering, to send the data to UA-XXXX-2. It will roll up in the same area of your analytics account, but it will totally separate and segment the data.
You can read more about the organizational concepts here at this excellent Google Analytics Help Center walkthrough.
To set this up, you'll setup a new profile within the account and select "Add a profile for a new domain" as your option. There's a detailed walk through here.

google analytics for subdomains - good practice

Say, I've a website www.website.com, and we are maintaining a subdomain sub.website.com for blogging. Now my question, what is a good practice of having google analytics for both domains, same tracking for both or individually? and why?
Regards
Generally speaking, the best practice is to keep subdomains of the same domain on the same account. (The exception is if the subdomains are completely unrelated sites.)
It's important, though, to adjust your Google Analytics snippet to set its cookies on the root domain, so that users who traffic between subdomains are tracked as a single visit, instead of multiple visits.
You can accomplish that by putting the following call before your _trackPageview call:
_gaq.push(['_setDomainName', 'example.com']);
Then, on the account management side, you can setup filters for individual subdomains (using Hostname filtering) so that you can get a snapshot of both the combined traffic and the individual subdomains.
EDIT: Removed the leading period on the URL. This will make it compatible with past traffic that doesn't have a setDomainName call.
[Expanded from comment above, as ran out of chars]
The setDomainName command as noted above will work, but if you're using an existing GA setup, using setDomainName = "example.com" (no leading dot) will retain existing GA user IDs, so the new-user metrics will still be valid (GA hashes the domainname into the user ID, but strips "www.example.com" down to "example.com" before hashing. However ".example.com" will hash to a different value, and the user IDs for returning users will not match their original IDs.
If you're starting a fresh site, use ".example.com" (and it's sometimes required for sites with deep FQDN), and don't forget to check what's being sent back to the GA with Firebug.
I think you can get away with just one domain. I never tried to use subdomains, but even with one domain, Google analytics gives you a good breakdown and visibility of the stats. Plus the urls of the pages are different and you can differentiate on that even if you track a single domain. Plus you will avoid domain-clutter.

Resources