I want to get the GA data with this setup:
Main domain: mydomain.com
Second domain: subdomain.myotherdomain.com/myfolder
So basically I want the visits to the main domain and the visits to the second domain to count as one page. The reason for that second domain is to redirect user to a secure area. That secure area is located in a subfolder, not in the root of the second domain.
I thought that as long as I put the same tracking ID everywhere it would be fine, but donig some research I found this from Google: Set up cross-domain tracking for multiple domains
Do I need this in my case? If so, how do I tell GA about just tracking the specific folder in the second domain? I will have other folders in the future that will need to be tracked separately from this account, so that's why I only want that folder...
Yes, you do need this (or else visits from mydomain.com to myotherdomain.com will be counted as two different visitors with mydomain.com as refering site).
You can use _setCookiepath (in the code for myotherdomain.com ) to limit the Google Analytics cookie to your subdirectory:
_gaq.push(['_setCookiePath', '/myfolder']);
(https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._setCookiePath)
Related
I have set up Google analytics on my root domain and all subdomains. I have a couple of goals set up and data is flowing into Google Analytics. I have a root domain (landing pages) and a subdomain for the service I'm selling. When going to Conversions > Goals > Overview in Google Analytics, my subdomain shows my root domain as the source and referral of all conversions. This makes sense since there is a link to sign up from my root domain to a signup page om my subdomain. But I would rather see the actual source/medium of the visitor coming to my root domain.
All domains log to the same UA property and I have set up a number of views to see data from the individual domains. GA is configured through Google Tag Manager as shown here:
Any idea to how to set this up?
The issue was with cross-domain tracking in GA. The main domain was not added to the exclusion list and that caused referrals to subdomains show up in the referral list. To solve it, just add the main domain to the exclusion list in the ga property.
The referral exclusion list is found under ADMIN > ACCOUNT > PROPERTY> TRACKING INFO > REFERRAL EXCLUSION LIST
This is a new setup, no historical data.
My objective is to be able to track the domain, as well as sub-domain.
Setup that i have:
domain.com - User generated content site
sub.domain.com - E-Commerce Shop.
Create a New Property for sub.domain.com in addition to domain.com ?
Or Create a Different View in the Property ?
To be precise, i need to know which method to select and why ?
Yes, there are previously asked questions over SO relating to "How to track sub-domains" but none show describing the reason to select an approach.
Sub-domains are tracked automatically by Google Analytics you just need to set the Cookie-domain property to auto.
You can create a new view for your subdomain and analyze data only for that sub-domain that would be more efficient.
Let say you have a site named mydomain.com and have one blog for that also like blog.mydomain.com.So, for both you can have different views and one combined view then it's up to you how you want to analyze the data.
ga('create', 'UA-12345-1', 'auto');
// is the same as
ga('create', 'UA-12345-1', {'cookieDomain' : 'auto'});
Refer the below document for more information on tracking sub-domains.
[https://support.google.com/analytics/answer/1034148?hl=en][1]
This depends on your use case.
If the content of your subdomain is strongly connected to your main domain you probably want to use the same tracker for both without modifications. This will allow you to track user sessions that move between main domain and subdomain. You would either create a view to filter by subdomain, or simply create a filter that adds the subdomain to the page path (so you can discern Urls from the main and subdomain) and look at them in the same view.
If main domain and subdomain share a tracker and a cookie with the client id this has at least two implications. Users that have visited your main domain in one session and the subdomain in another will be recognized as recurring users. Also sampling in a free GA account happens on the property level, so if you track main domain and sub domain via the same tracking id sampling will occur more frequently (on sites with much traffic).
If you want to avoid either you should use separate GA properties for main domain and sub domain and maybe change the cookie domain for your subdomain (documentation for the current gtag.js is here).
What's the best way to track across subdomains? Here's the scenario:
Customers on my site can create their own custom site name or subdomain. For example, if John Doe signs up as a customer, they can create their own personal subdomain of: johndoe.mydomain.com. In a sense, subdomains are created dynamically as each new customer signs up and creates their own subdomain.
Once someone signs up as a customer, they have access, or the ability, to sign up for another service that allows them to accept online donations. Should they choose to buy this capability or product, they are taken to a subdomain of: admin.forms.com. It's on this subdomain where customers can purchase this add-on. So basically, customers are moving from their own custom subdomain to admin.forms.com to signup for this service.
The goal is to see how many customers are signing up for this service. Does it make sense to create a new property for admin.forms.com? Or should I use a view or segment?
Thanks in advance for any suggestions/insight.
Since the subdomains actually belong to different domains you would need to set up proper cross-domain tracking if you want to track across domain boundaries.
Pageviews by the same visitor are connected to a session via the clientId. The clientId is stored in a cookie. Cookies are domain specific. Since cookies from mydomain.com cannot be read by a client browsing forms.com the clientId needs to be carried over as query string parameter. That's what cross domain tracking does.
Since you want to view traffic to your two (sub)domains as if this was a single domain (i.e. you want an uninterrupted "user journey") using additional views or properties would defy your purpose).
Unless you specifically set the cookieDomain value either to "auto" or to the top domain the cookie will be valid for the subdomain(s) only, so you won't have to worry that this interferes with tracking on the top domain level (however if you expect users to browser on the top domain level (e.g. switch from admin.forms.com to plain forms.com) then you should set the cookieDomain field to auto, else GA will allocate a new clientId when the user switches from subdomain to main domain).
I'm trying to set up tracking with GTM between the main domain and its subdomain. I've read a lot on this topic already, including this Google guide (it's about different domains but not sub-domains) and guide from Lunametrics. But still I can't find the answer.
So what I have now:
site.com and blog.site.com
Two separate containers for each of them
Two different properties in Universal Analytics.
What I need is tracking the domain with it's subdomain. I assume I'll need to create a separate view with filters in GA. Please let me know how to configure that tracking right. I wouldn't like to use one single container for the domain and its subdomain.
What you need is a single property. Implement the same code on domain and subdomain.
Set the cookie domain to "auto" (or do not set it all). This means the Google code sets the cookie for the highest accessible "level" from the domain (i.e. Google cannot set a cookie for the .com TLD, so it will use the next level, in your example site.com). It also means the cookie is available on the subdomains for your url.
That's basically it - your property will report users from domain and subdomain and will maintain the session when they switch between domain and subdomain.
However if you have pages of the same name on both domain and subdomain - say site.com/index.html and blog.site.com/index.html - they will be lumped together in the reports. To separate them you can set the hostname as second dimension, or apply a filter to your data view that adds the hostname to the url path (here is randomly googled tutorial on how to do this).
I've got a domain name lets call it example.com, which has multiple subdomains.
blog.example.com
shop.example.com
press.example.com
site.example.com
I'm trying to get these domains to all report properly in google analytics, first I'll share my current configuration then the issue that it caused.
Current configuration:
Under the Tracking Code tab in the admin.
What are you tracking? = One domain with multiple subdomains
The root domain, example.com's profile is set as follows.
A subdomain, blog.example.com's profile is set as follows.
These subdomain profiles show up all under one account like they should.
I am not using any filters, and I just tried to filter by subdomain and I can't get it to work, no matter what the content and the numbers are all the numbers for example.com.
Problem with this configuration
All of the profiles have the same data, the content from the root domain.
I previously was not using filters now I am one for each subdomain looks like this:
I haven't tried this, but setting up profiles could help as described here: http://www.ericmobley.net/guide-to-tracking-multiple-subdomains-in-google-analytics/
You need to understand the concept of "Accounts" and "Profiles" within Google Analytics.
Your account name is "Example site". If you want the data from subdomains in separate profiles, create separate accounts(not separate google accounts).
All profiles within the same account will have the same data.
Hint for you to find out account. All profiles within a folder group belong to the same account. Create separate top level folder groups.
I previously was not using filters now I am one for each subdomain looks like this:
Although I don't think this an issue with GA anymore.