Referring subdomain traffic showing up as direct traffic in Analytics - google-analytics

I have two sites http://www.beachcomberhottubs.com/ and http://estore.beachcomberhottubs.com/ with two different Analytics codes on them.
I can see from event tracking that people are clicking from the main domain to the subdomain, but there is no referral traffic from the main domain on the subdomain's Analytics. Almost all of the traffic is coming up as direct traffic.
Any idea why this might be?
Thanks!

I think GA is treating the estore site as the same site due to the following command
ga('create', 'UA-47011605-1', 'beachcomberhottubs.com');
ga('send', 'pageview');
giving it the same top level domain as the www site. I think it should be
ga('create', 'UA-47011605-1', 'estore.beachcomberhottubs.com');
ga('send', 'pageview');
to show that it's a different site to www.beachcomberhottubs.com

Related

cross domain tracking goals go to direct

I have an issue with cross domain tracking for one of my clients.
When people go from one site to the the other they go to a different domain. There they finnish a servey and they convert on that site.
I have analytics set up and the data comes in from both websites, but the conversions are registered for direct en referral. I want to know what keywords in Adwords turned into the conversion.
can someone help me with this issue?
You'll need to set up cross domain tracking as described in this support article.
If you use Google Tag Manager, you can use the "Auto Link Domains" functionality that will take care of the details.
Otherwise, you'll essentially have to change the intialization of your tracking snippet from
ga('create', 'UA-XXXXX-Y', 'auto');
to
ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['your-second-domain.com'] );
Note that these solutions always require that you use the same Analytics property ID on both sites.

Why are my Google Analytics Page Timings all 0.00%?

Why are my Google Analytics Page Timings all 0.00%?
Is doing something like this enough to get page timings or is there something different I should be doing?
/* GOOGLE ANALYTICS ID */
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', [myid], 'auto');
Other stats are working using same ga which I set to my account ID.
That's because of bounce rate.
When a visitor comes to your site, he or she gets a timestamp. So, Analytics might note that User landed on your Homepage at 17:35:03. Then, Analytics assigns a new timestamp when that user accesses a new page on your site. So if user clicks on a link to your About page at 17:36:04, that leaves your Homepage with a Time on Page of 00:01:01.
But what happens if user never accesses another page on your site (in other words, if bounces?
Then there's no second timestamp for Google to work from. So they assign a Time on Page of 00:00:00.
There are few workarounds.
One is explained here: tracking adjusted bounce rate.
I am struggling with this issue as well. After researching the page tracking site timings, it appears there could be a few issues causing the timings not be recorded:
GA Support
If you see Help in the PageSpeed Suggestions column, this indicates that we were unable to analyze the page at the given URL, and you should try again later. If the error persists, it may be due to any of the following:
-The hostname you have configured in the Website’s URL section of your View Settings is not a valid hostname for your website.
-The URLs shown in the Site Speed Suggestions report are not valid URLs for your website.
-You are tracking multiple subdomains and not using a single hostname.
-You have set up view filters to rewrite your URLs.
-The page requires authentication.
Most concerning to me is the "page requires authentication" item. I think that will prevent me from collecting this data.

Track user activity from different domains (but same site) with google analytics

I've got a site that has many domains and subdomains. They all go to the same pages and do the same stuff. The only thing that changes from domain to domain is the images and colors of the site. So I wanna track the users activity and started using google analytics. I changed the google script to this:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-X', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['domain2.com'] );
ga('send', 'pageview');
</script>
But this only gives me the data from all activities in the browser no matter from which domain it came. I wanna know if it's possible to also separate which domain had more hits and stuff like that. Is it possible? Is there any other tool where this is possible?
Thanks :)
Sounds like you are tracking all (and any) of your domains with that code snippet you provided. Some best practices are to
set up a view for each domain (with the appropriate Include filter applied) and also
set up a Roll-up view that contains data for all your domains, and you would definitely need an Prepend hostname filter so you can see which domain traffic comes in from.
set up a Raw view that is completely unfiltered,
and finally set up a Test view for testing out new configurations.
Edit: Here's a screenshot of how you would include a filter for a specific domain:

Google Analytics Cross-Domain Conversion Tracking and Attribution to AdWords Campaign

Background
We have a number of websites that we maintain and we have Google AdWords Campaigns running to drive traffic to these sites.
For Example:
www.example1.co.uk
www.example2.co.uk
www.example3.co.uk
After browsing these sites, a customer will be redirected to our E-Commerce platform if they decide to make a purchase (this is where the conversion happens):
www.example-checkout.com
Current Google Analytics Setup
Our current Google Analytics Setup looks like this:
www.example1.co.uk, www.example2.co.uk, www.example3.co.uk
ga('create', 'UA-12345678-1', 'auto', {'name': 'globalTracker'});
ga('globalTracker.send', 'pageview');
ga('globalTracker.require', 'linker');
ga('globalTracker.linker:autoLink', ['example-checkout.com'], true);
www.example-checkout.com
All Pages
ga('create', 'UA-12345678-1', 'auto', {'allowLinker': true, 'name' : 'globalTracker'});
ga('globalTracker.send', 'pageview');
Checkout Page Only
The checkout/confirmation/thank you page contains additional calls to load the Google Analytics E-Commerce plugin and post the details of the transaction that has occurred.
ga('create', 'UA-12345678-1', 'auto', {'allowLinker': true, 'name' : 'globalTracker'});
ga('globalTracker.send', 'pageview');
ga('globalTracker.require', 'ecommerce', 'ecommerce.js');
ga('globalTracker.ecommerce:addTransaction', {
'id': '${transactionID}',
'affiliation': '${affiliation}',
'revenue': '${revenue}',
'shipping': '${shipping}',
'tax': '${tax}'
});
ga('globalTracker.ecommerce:send');
What Works
The E-Commerce tracking code appears to work and conversions are recorded. In Google Analytics we can see that we received traffic/clicks from our AdWords campaigns which suggests that the _ga cookie is being correctly passed cross-domain from www.example1.co.uk to www.example-checkout.com (in fact I have verified this using the Chrome Developer Tools / Google Analytics Debugger Plugin).
Problem
The problem is that the conversions are never attributed to the AdWords Campaign & AdGroup. The source of the conversion is always a referral (E.g. from www.example1.co.uk).
What am I missing? I want to see the conversions attributed to the AdWords campaign. I.e. in the "Acquisition -> Campaigns" section of Google Analytics.
Any pointers are greatly appreciated.
You do not mention that you use any decorator functions (i.e. functions that add the ga parameter to outgoing links, forms etc.) and allowLinker does not do this automatically. So it should be not possible that cross domain tracking works at all (i.e. both domains will be tracked but on changing the domain the user will start a new tracking session). (UPDATE: Sorry, I did not see the autolinker plugin in the code, so ignore this paragraph).
Plus you need to add both domains to the referrer exclusion list in the property settings (this will remove the referrer no matter what, so make sure that the client id is passed on before you do that).
Unless you have used decorators without saying so in the question this is most likely your problem. Look into the outgoing urls if the ga parameter is appended when switching domains and make sure that the ga code on the other domain does actually receive the parameter (i.e. if there are redirects make sure they retain the parameter).

Google Analytics on Subdomain

I just generated the tracking code for a new Google Analytics account, and the domain I want to track is actually a subdomain. When setting up the account, I entered the subdomain as the URL I wanted to track, but I noticed when the tracking code was generated, it referenced the main domain and not the subdomain I had entered. Please see below, and please note that in the code below, I replaced the actual domain with "example.com". So, I have two questions related to this
I plan to insert this tracking code on my subdomain, but do I need to do anything special in the analytics settings to ensure that I only see stats for my subdomain and not the main domain? I don't have control over the main domain, and they don't have analytics installed on it.
If the person in charge of the main domain decides to install analytics on the main site, will my code affect his account in any way being that my tracking code references the main domain instead of my subdomain?
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46251874-1', 'example.com');
ga('send', 'pageview');
</script>
According to Google's analytics help, specifying the root domain in the way you have will allow you to track stats on subdomains. So no, it doesn't seem like you need to do anything special.
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite#domainSubDomains

Resources