Analytics
5.4K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Different cases for cross-domain tracking

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi!

I assume this question has been asked before but I simply can't find it, so I apologize in advance if it's a repeat.

 

I have site A and site B and would like to setup a view in which I can follow traffic as it moves between the two sites. What type of cross-domain tracking should I use for each of the following cases?

1. Site A and site B have the same domain but are in different properties. 

2. Site A and site B have different domains but are in different properties.

3. Site A and site B have the same domain and are in the same property.

4. Site A and site B have different domains and are in the same property.

 

I assume the answers are:

1. Sub cross-domain tracking

2. Cross-domain tracking

3. Hostname filter in view settings

4. Hostname filter in view settings

 

Can someone verify whether this is correct?

 

Many thanks in advance!

 

 

Re: Different cases for cross-domain tracking

[ Edited ]
Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭

Hi Jacob,

 

I guess that's what you're looking for:

 

a) blog.domain.com and domain.com

You just need tracking across subdomains. If you look at you GA tracking code, make sure you have 'auto' there: ga('create', 'UA-XXXXX-Y', 'auto'); or if you use GTM, make sure you have set cookieDomain: auto. You don't need to use a separate UA tracking code. You should use the same tracking code on both sites.

 

 cookiedomain.png

 

b) blog.domain1.com and domain2.com

 

First of all, you need tracking across subdomains and you'll need to make sure you use the same UA tracking code (property) on both websites. If you look at you GA tracking code, make sure you have 'auto' there: ga('create', 'UA-XXXXX-Y', 'auto'); or if you use GTM, make sure you have set cookieDomain: auto. In addition, you'll need to set up cross-domain tracking across domains and you should use a hostname filter that displays domain names in your reports. Filter settings:

  • Filter Type: Custom filter > Advanced
  • Field A: Hostname Extract A: (.*)
  • Field B: Request URI Extract: (.*)
  • Output To: Request URI Constructor: $A1$B1

   

c) domain1.com and domain2.com

 

First of all, you need to make sure you use the same UA tracking code (property) on both websites. In addition, you'll need to set up cross-domain tracking across domains and you should use a hostname filter that displays domain names in your reports. Filter settings:

  • Filter Type: Custom filter > Advanced
  • Field A: Hostname Extract A: (.*)
  • Field B: Request URI Extract: (.*)
  • Output To: Request URI Constructor: $A1$B1

 

 

If you'd like to read/learn more about that, I recommend reading those 2 amazing articles:

1) http://www.simoahava.com/analytics/cross-domain-tracking-across-subdomains/

2) http://www.simoahava.com/analytics/troubleshooting-cross-domain-tracking-in-google-analytics/

 

Hope this helps. Let us know if you have any further questions.

Taavi

 

Different cases for cross-domain tracking

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi!

Thank you for your reply!

 

I have some concerns however, if you look at example 1 & 2, the domains are placed in different properties. You briefly mention that they need to be in the same property but for me to put them in the same property would require me to scrap all historical data, which is something I'd very much like to avoid.

Can you confirm that for your solutions to work the domains has to be moved to the same GA property? If yes, are there any other solutions that doesn't require me to move the current domains?

 

Thanks again!

 

Different cases for cross-domain tracking

Participant ✭ ✭ ✭
# 4
Participant ✭ ✭ ✭

Hi,

 

If you'd like to track 2 or more different domains or subdomains together, you'll need to use the same Google Analytics property.

 

Cross-domain tracking only works when you want to see two domains show up on one report. In the situation you describe, you are talking about two web properties. This is sort of the opposite of cross-domain tracking. It’s basically having each domain tracked separately.

 

I would recommend creating a completely new property for that and continue to use older properties as well. You can have multiple tracking codes on a website.

 

Unfortunately, you cannot change your historical data, so it's better if you create a completely new property and then implement cross-domain tracking if it's needed. Then you don't need to scrap all historical data.

 

Hope this helps. Let us know if you have any further questions.

Taavi

 

Different cases for cross-domain tracking

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi!

Thank you so much for the clarification! Now it's much clearer!

 

I have a follow-up question regarding example "3) Same domain and same property" so instead of posting a new question, I'll place it here instead. 

 

I have setup a new view with a filter including traffic for both subdomains (Site A and site B) and I've made sure that the tracking code has "auto" in it to ensure cookie-sharing is enabled. However, I'm still seeing Site A in the referral list and I'm not sure what's wrong.

 - Do I have to add Site A in the referral exclusion list? 

 - If not, can the problem be that I have to enable CookieDomain = auto in GTM? I assumed that it would be enough to have it in the tracking code. 

 

I don't want to have to add Site A to the referral exclusion list as I'd like to have a separate view within the same property for just Site B and if I have Site A in the referral exclusion list I won't see those referrals. 

 

Thanks again for your assistance!

Re: Different cases for cross-domain tracking

[ Edited ]
Participant ✭ ✭ ✭
# 6
Participant ✭ ✭ ✭

Hi Jakob,

 

If I understood correctly, you'd like to use cross-domain tracking across subdomains.

 

For example:

Site A:  site1.domain.com

Site B:  site2.domain.com

 

1) You should add domain.com to your referral exclusion list and everything will be fine. If visitors move from site A to site B or from site B to site A, sessions will continue and you'll see the actual referrals or campaigns in your report that brought those visitors to your site.

2) If you're using GTM, you should set CookieDomain -> auto

 

cookiedomain.png


If you'd like to read more about the referral exclusion list, check this out: 
https://www.en.advertisercommunity.com/t5/Google-Analytics-Referral-Spam/Referral-exclusion-not-work...

 

There you can find a long discussion that would help you out.

 

Hope this helps.

Taavi

Different cases for cross-domain tracking

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi again!

 

Thanks again for your reply!

This explain quite a bit, however, one major issue remains.

 

I have site1.domain.com and site2.domain.com and I create the following views:

- Cross-subdomain tracking

- Site1.domain.com

- Site2.domain.com

 

If I include site1.domain.com in the referral exclusion list, this means that if I ever view the site2.domain.com-view it will show incorrect data as it is excluding referral sessions from site1.domain.com - is this correct?

 

Thanks as well for the link to the other thread regarding referral exclusion, it was very helpful!

 

Thanks again for all your help!

Different cases for cross-domain tracking

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

Hey everyone!

 

Can anyone else provide me with some help with my last question in my previous message?

 

Thanks in advance!

Different cases for cross-domain tracking

Participant ✭ ✭ ✭
# 9
Participant ✭ ✭ ✭

Hi Jakob,

 

Sorry for the late response.

 

To be honest, I would not recommend using a separate view for each subdomain because if you put different subdomains, for example, in different views, all hits to subdomain pages outside the view you’re working in will show up as (not set). I see these (not set)’s show up most commonly in content reports.

 

You should use advanced segments instead of that to analyze your subdomains.

 

Hope this helps.

Taavi

Different cases for cross-domain tracking

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

Thank you for your reply!

 

Currently we are using domain filters on each view to only get the traffic on that specific domain. Does this solve the problem?

If not, how do you recommend I structure the views if I want to both be able to analyze the domains together and separately? 

 

Should I set it up in two separate properties like this?

Property 1:

 - Site A & Site B (subdomain) - Cross-subdomain tracking

Property 2:

 - Site A

 - Site B

 

Thank you again so much for your help!