AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
2.5K members online now
2.5K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Multiple domains tracking and Host name

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I use the Linker plugin to track traffic on my subdomain. Shouldn't I see the host name of subdomain pages the same as root domain thanks to this plugin? I thought all the host names will be displayed as the root domain... Any ideas?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Adam W
February 2017

Re: Multiple domains tracking and Host name

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

Adam, it seems like everything works properly right now:

 

1. Subdomain

 

(author asked me to remove the image)

 

2. Root domain

 

(author asked me to remove the image)

 

As you can see client ID didn't change. Now, if you remove linker plugin, we can test it again but I am pretty sure that you don't need it. Smiley Happy

 

Let me know if you've removed this linker plugin, I will test it once again.

 

Cheers,

Taavi

View solution in original post

Re: Multiple domains tracking and Host name

Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭

Hi Adam,

 

If you'd like to track users across subdomains, you don't need a linker plugin. Linker plugin is for cross-domain tracking. Hostnames will not change if you implement cross-domain tracking.

 

Subdomain tracking: subdomain.yourdomain.com -> yourdomain.com

Cross-domain tracking: yourdomain.com -> mydomain.com

 

If you'd like to track users across subdomains, you'll need to set cookieDomain to auto. If you use the default Google Analytics setup, it's already configured (take a look at your Google Analytics tracking code). If you use GTM (Google Tag Manager), you'll need to modify your settings:

 

Screen Shot 2016-11-27 at 05.52.51.png


Again, you don't need to use linker plugin in order to track users across subdomains. Smiley Happy

 

Hope this helps.

Taavi

Multiple domains tracking and Host name

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Dear Taavi,

 

thanks for your reply. I think in my example I have to use Linker plugin because I want to track subdomain (with http) traffic to online shop (https protocol). Can you confirm that?

 

Btw. in my universal GA code I can't see this cookieDomain:

 

<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','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-xxxxx-1', 'auto');
ga('send', 'pageview');

</script>

Multiple domains tracking and Host name

Participant ✭ ✭ ✭
# 4
Participant ✭ ✭ ✭

Hi Adam,

 

As you can see your Universal Analytics code includes 'auto' as the third parameter of the 'create' command. That’s the equivalent of adding the field cookieDomain : 'auto' into the tracker object. So it's already configured.

 

If the traffic lands on the subdomain first, and then moves to the parent domain and you see different _ga cookies and different Client IDs on both domains you'll have to think about linker plugin. In this case, I guess you don't have this problem. But let's take a look.

 

Could you please share your subdomain and root domain? (You can remove or modify your next post later if you don't want to show your domain to other people.)

 

I will take a look at your configuration and will let you know what should be done.

 

Looking forward to hearing from you.

Taavi

Multiple domains tracking and Host name

[ Edited ]
Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Taavi,

 

yes of course. You can look at it here:

(hidden link)

 (at the bottom you can see 'Contact Us' hyperlink to Root domain)

 

 

 

Thank you in advance!

Marked as Best Answer.
Solution
Accepted by topic author Adam W
February 2017

Re: Multiple domains tracking and Host name

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

Adam, it seems like everything works properly right now:

 

1. Subdomain

 

(author asked me to remove the image)

 

2. Root domain

 

(author asked me to remove the image)

 

As you can see client ID didn't change. Now, if you remove linker plugin, we can test it again but I am pretty sure that you don't need it. Smiley Happy

 

Let me know if you've removed this linker plugin, I will test it once again.

 

Cheers,

Taavi

Multiple domains tracking and Host name

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Ok, I've changed it like u said. 

 

Would you like to check it one more time? Smiley Happy

 

Thanks Taavi!

Re: Multiple domains tracking and Host name

[ Edited ]
Participant ✭ ✭ ✭
# 8
Participant ✭ ✭ ✭

Hi Adam,

 

I did it. Here you'll see the results:

 

1. Landed on your subdomain:

 

(author asked me to remove the image)

 

2) Went to your homepage (root domain) through this Contact Us link:

 

(author asked me to remove the image)

 

Finally, I went back to the subdomain and still saw the same Client ID.

 

As you can see Client ID didn't change so the same session continued. Smiley Happy

 

So if you set CookieDomain: 'auto', everything will be fine as long as you're driving people from your subdomain to your root domain or vice versa. But if you're driving people from store.com to store2.com, you'll need a linker plugin and cross-domain tracking.

 

If possible, I highly recommend moving your site (subdomain) from HTTP to HTTPS. Why?

 

Because, if people are coming to visit your subdomain page first (they click on the link that drives them to your subdomain and this website that is pointing to you is using HTTPS), the referrer information will be missing and you'll see (direct) / (none) in your Google Analytics reports instead of this specific website (referrer). It happens very often.

 

This doesn't happen if people are coming to visit your subdomain from Facebook, Twitter or Google. They all use an internal redirect script that first redirects a visitor to a non-HTTPS page before sending the visitor to the actual URL on a HTTP site.

 

Here you can read more about that if you're interested.

 

Hope this helps.

Taavi

Multiple domains tracking and Host name

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

That's great info! Smiley Happy

 

How can I move my subdomain to HTTPS?

 

My rootdomain has automatically HTTPS thanks to Shopify.

Multiple domains tracking and Host name

Participant ✭ ✭ ✭
# 10
Participant ✭ ✭ ✭

Adam, you should get in touch with your hosting provider and ask for Wildcard SSL Certificate.

 

Hope this helps.

Taavi