Google analytics for any domain - google-analytics

Is there any way to track analytics for for all domains except a specific one?
If I develop a tool that will be integrated in some websites, I don't know what is the domain to track, but I would track the access from any domain.
How can I do that?

The Google Analytics tracking code will work for all domains if you set the Cookie Domain to auto (or "none", but that has side effects that "auto" has not). You can then filter or segment by hostname to get data for individual domains.
However this is not the same as "cross-domain" (since you tagged your question with that). Cross domain tracking means "tracking multiple domains as one property", so GA sessions will be maintained even when crossing domain boundaries. This is not relevant at all to your use case.
Maybe it would be better if you implemented tracking via the measurement protocol. If you simply add GA tracking code to existing websites you might break tracking that is already there, if you build your own solution on top of the measurement protocol you don't have to worry about that but you can still use the standard GA reporting interface.

Related

Can you implement google analytics with no domain binding?

We have a web service which is installed on different stations. Each has a different ip and domain. we want all of them to report to the same suite.
Can this be done?
The JavaScript tracker for Google Analytics can be used if you allow calls to the Google Servers, if you allow your clients to execute JS and either can set cookies or provide a client id in some other way (must not be personally identifiable data).
If you cannot use Javascript then you could still collect data via the measurement protocol, although this might require substantial development effort.
The domain setting in the Google Analytics interface does not affect data collection, it is used in the (soon to be removed) in-page analytics feature and as base url for the "open document" feature in the behavior reports.
Google Analytics does not collect by domain, but by property ID (UA-XXXXXXX-X), else cross-domain tracking would not be possible (it is actually a documented feature).
Cross domain tracking would be important if somebody could hop from one of your stations/domains to the other and you wanted this to be tracked as a single session. This does not seem to be your use case.
The only pitfall is that the reports display page paths, not full URIs. So if you have similar paths on all your stations the metrics for the page paths will be lumped together unless you do a breakdown by hostname. A common workaround is to add a filter to your data view that prepends the hostname to the path, or to provide custom paths in the first place.
But basically this is not a problem. If you do not need cross domain tracking you'll be okay if you dump the same tracking code in all your sites.

multiple domains, how to use the same GA property

I am trying to implement cross domain tracking for two of my domains. While reading the Google Docs on the matter, I got confused by the following paragraph toward the end of the article (bold text):
Both domains need to use the same GA property in order for cross-domain tracking to work correctly. If the sites use different properties, no session information will be shared and cross-domain tracking will not work.
Cross-domain tracking supports multiple trackers, but be aware that they will all share the same Client ID used by the linker.
The scenario I have is:
example.com --> the first domain used to promote my product
domain2.com --> the second domain which is used for secure checkout.
When creating a properly in Analytics, I need to enter the default url. How can I set this up so that I can then use the same property code for both domains?
Can't find any other related questions or articles on this, so I feel I am missing something simple.
It means that you have to use the same UA ID on both sites so that the GA property can collect the data on those 2 sites. You should use GTM to do cross domain tracking since it is much easier to set-up.
I recommend following the instructions here http://www.lunametrics.com/blog/2015/06/16/cross-domain-tracking-with-google-tag-manager/

Is Google's Documentation Correct on How Cross-Domain Tracking Works?

Researching options for Universal Analytics to setup cross-domain ecommerce tracking. Project has 3 existing separate Google Analytics Accounts for 3 domains, not setup for cross-domain tracking currently. Setting up Universal Analytics to track conversions across those multiple domains from original traffic course to cart conversion.
I have done this before for other funnels using separate Property IDs for each domain, so was surprised to read this in the Google Docs for Universal Cross-Domain tracking:
"Both domains need to use the same GA property in order for cross-domain tracking to work correctly. If the sites use different properties, no session information will be shared and cross-domain tracking will not work." [my emphasis]
When you autolink, you pass the _ga parameter, and it seems like this works across multiple accounts (or across multiple properties) to connect (for instance) PPC campaigns > domain 1 to eventual revenue > domain 2 (or 3, etc.).
So, what is being said here? Is it just plain wrong, or something that I am missing about sessions? For multiple domains, is your experience implementing this that a rollup property is required? Or preferable in some way?

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).

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.

Resources