How to limit event tracking to single domain in Google Analytics - google-analytics

When I'm looking at the Google Analytics Events with hostname as second dimension, I can see my local domain plus my test domain mixed up with the data from my real production domain.
Is there a way to tell google analytics to ignore and not record events from any other domain except my real production domain?
I tried creating a View Filter to include only results from my real domain but that does not have any effect on events.
Any help would be appreciated.

Related

Google Analytics: Which domains are sending data

Is there a way to tell which sites my Google Analytics tracking code is implemented on? I am suspecting it may have been used with different micro landing pages with different domains and sub-domains. (Our developers were testing a cross domain tracking but did not went as expected)
I could not figure out where to see this on my GA reports, tried to search it but all ends up explaining referrals list which I am not looking for:(
You can check what Hostnames are sending data to the GA reports for a Property, via the Audience > Technology > Network report. Change the Primary Dimension from Service Provider to Hostname.
Filters are not retroactive, so you can instead create and apply a Segment based on Conditions to Filter Sessions Include based on Hostname that exactly matches yourdomain.com.
Doing this will allow you too also view the historical data in your reports in relation to valid Hostname
More info on building segments from the GA Help Center
https://support.google.com/analytics/answer/3124493?hl=en

Google analytics Direct vs Referral traffic for 2 sites being on same domain name

I have a site abc.com e.g. It has a UK and US variant with different content and based on country of access directs to abc.com/en-gb or abc.com/en-us.
Now in the site in the footer there is a link to our App-store website. Now that website too uses the same primary domain name of abc.com but at the proxy based on URL directs it to a completely separate installation of a stand-alone site which is abc.com/app-store.
Both the sites have different GA tracking code enabled. the abc.com corporate site has GA360 (Analytics pro) while the abc.com/app-store uses regular GA account. Basically no way the 2 are connected.
Now what I see is any traffic coming from abc.com/en-gb or abc.com/en-us to abc.com/app-store is being recognised as "Direct" traffic type in GA. While actually it is a "Referral" though they are both sites owned by us.
We need to somehow measure the traffic being sent to our app-store from our corporate site in the GA in the app-store for reporting purposes. We can track traffic sent from abc.com in the GA360 enabled on abc.com/en-gb and /en-us but then it is a different GA account and data store and needs manual sync up.
I had thought of using utm campaign source/medium - but that is giving false impression of bloated traffic as the UTM URL paramters remain even after landing on the destination site and for any filtering operation on the site it keeps reloading - giving the false impression of traffic coming from abc.com.
Any advice?
The reason abc.com/app-store GA account shows this in 'direct' because the referrer is the same domain. And Google will consider this as self-referrer.
GA doesn't care if you have 3 different GA set up in 3 different pages but the domain from which it is referred to, if it is different then it is fine else it considers it as 'direct'. Equivalent to user opening a bookmark.
How to solve this,
Use outbound event tracking on abc.com/en-gb & abc.com/en-us. But it will lead to manual merging of the data.
As UTM parameters are messing up your app store campaign data and filtering options, you can go with the ref parameter. I usually use it for tracking internal navigation. for example - abc.com/app-store?ref=main_site. You can easily filter out ref parameters from your view or create a segment. And it is considered different than the original URL, so no clashes.
Hope this helps

How can I test/verify if users are tracked across subdomains n Google Analytics?

I have my UA setup across three sites www.aerserv.com, platform.aerserv.com, and support.aerserv.com. I want to be sure I'm tracking users across the domains properly so the analytics don't see each visit from one user as a "new user".
Is there a way to verify that I've setup my tracking correctly and Google isn't mis counting visitors?
Subdomain tracking is done out of the box in GA, and the only thing you need to make sure is that the cookie domain setting is set to 'auto', and that the referral exclusion list includes the main domain. Once you have those set, and if all pages across all applicable subdomains are tagged, then you should not have any issues. If you need to check, then you can look at the client ID (cid) for each pageview hit from one subdomain to the next. The client ID should be the same.

Self referral in Analytics

I use Google Adwowrds and Analytics for my website, when I check, as the main source of sessions, is shown paid searches (adwords), but Google Analytics shows that most of the referrals for transactions (Purchases) from my own website.
There are two possible reasons for this in my situation. Cross Domain Tracking and Page Dropping Cookie.
Regarding Cross Domain Tracking, I use single domain, but after the customer checks out, the Thank You page comes with Shopify domain, can it be considered that I use multiple domain?
Regarding the Cookie Drop out, how can I find it out? and fix it.
When a user moves from one domain (your domain) to another domain (the Shopify domain) then a new Google Analytics cookie is generated and this cookie has a difference client ID stored in it for Google Analytics. So even if the Shopify domain is sending data to the same Google Analytics property, since the client ID is different, Google Analtyics will treat this as a new user and a new session and in the eyes of Google Analytics, this session will be a referral from the first domain (your website).
If you want to prevent this from happening, you must implement cross-domain tracking which you can read about here.

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

Resources