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
4.3K members online now
4.3K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Tracking CTA over main domain to subdomain

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Thanks in advance for any help.

 

A couple of things: 

 

I want to be able to track clicks on CTA from my main site to the shop which is on a subdomain. For example, 'Buy now' on homepage of main site to that product in the shop. Similarly, for links in a blog to the shop. What is the best procedure for this? Events? Tag manager?

 

At the moment the sub-domain is set up with a separate ID to the main site, is that the wrong way?

 

Presumably, it would be good to be able to see the paths as users migrate from the main site to the ecommerce subdomain. Is that possible?

 

 

 

 

2 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by James_Clemens (Top Contributor)
July 2017

Tracking CTA over main domain to subdomain

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi Warren, 

 

Sub-domains are automatically configured for multi-domain tracking, they also should automatically be inserted as a referral exclusion. 

Source: https://support.google.com/analytics/answer/1034148?hl=en

 

My advice: create a property for each individual domain and then a dedicated property for BOTH your main domain and it's subdomain. 

 

Let me know if that answers your question! 

- Josh

Joshua, Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

View solution in original post

Marked as Best Answer.
Solution
Accepted by James_Clemens (Top Contributor)
July 2017

Tracking CTA over main domain to subdomain

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi Warren, 

 

Sub-domains are automatically configured for multi-domain tracking, they also should automatically be inserted as a referral exclusion. 

Source: https://support.google.com/analytics/answer/1034148?hl=en

 

My advice: create a property for each individual domain and then a dedicated property for BOTH your main domain and it's subdomain. 

 

Let me know if that answers your question! 

- Josh

Joshua, Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Tracking CTA over main domain to subdomain

[ Edited ]
Top Contributor
# 3
Top Contributor

Hi @Warren C :-)

You may want to look into setting up subdomain tracking in order to track paths/users between the two

http://www.lunametrics.com/blog/2016/08/11/subdomain-tracking-google-analytics/

 

(eta oops @Joshua R I seem to have cross posted with you :-) )

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Tracking CTA over main domain to subdomain

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Thanks to Bronwyn and Joshua. Is the subdomain tracking automatic or does it need to be set up?

 

If I set up another property will it then generate another analytics ID that I have to put into the main site and subdomain to track them? 

 

Tracking CTA over main domain to subdomain

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Joshua. You say to create 3 properties - is it possible to create 3 properties with the one tracking code or several tracking codes? Can you add more than one tracking code to a single website? Not sure how this setup works? Thanks, Warren

Re: Tracking CTA over main domain to subdomain

[ Edited ]
Top Contributor
# 6
Top Contributor

@Warren C

 

Unless you need to track the subdomain completely seperate to the main domain then seperate properties are not required. To setup Subdomain tracking to track users between the parent and subdom, needs to use a single property.

If you do not need to track them entirely seperate, take the tracking code for the subdomain off the subdomain.

Add the tracking code for the main domain onto the subdomain too.
Keep the subdomain property, do not delete it, simply for reference to the historical data.

The in the Property for the main domain that now tracks both

Create a new View, call it something like Master Both Domains

and apply the following filter

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

 

If you do want to continue tracking them with their own properties.. but also want to setup subdomain tracking too.
Leave each of them with their tracking from the different Properties

Create a new Property and then on the Main domain edit the tracking code snippet to be a single snippet as such

 

Main domain (tracking id UA-XXXXX-A)

Subdomain domain (tracking id UA-XXXXX-B)

Tracker for Tracking both together (tracking id UA-XXXXX-C)

 

 Main domain

ga('create', 'UA-XXXXX-A', 'auto');
ga
('create', 'UA-XXXXX-C', 'auto', 'clientTracker');

ga('send', 'pageview');
ga
('clientTracker.send', 'pageview');

 

 Subdomain domain

ga('create', 'UA-XXXXX-B', 'auto');
ga
('create', 'UA-XXXXX-C', 'auto', 'clientTracker');

ga('send', 'pageview');
ga
('clientTracker.send', 'pageview');

Then in the Property for US-XXXXX-C

Leave the initial View without any Filters

Create a new View, call it something like Master View

and apply the following filter

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

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Tracking CTA over main domain to subdomain

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Thanks. This is the best response