Analytics
2.9K members online now
2.9K 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

Help with Goal setup across multiple domains

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I've read various posts on goal setup across domains.  But before I ask my developer to add code to our websites, I want to be sure I understand.

 

The same GA code (UA-XXXXXXXX-1) is set up on all pages.

 

Here is an example of one of my goals / funnels:

 

1.  user visits my primary domain

2.  user clicks through to a landing page on a subdomain (lp.domain/pagename/)

3.  user clicks through to sign up form on second subdomain (production.domain/product/signup)

4.  user completed form and is directed to confirmation page also on second subdomain (production.domain/product/confirmation)

 

Do I need to add the following code to each of my subdomain pages:

 

<!-- Google Analytics -->
<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-XXXXXXXX-1', 'auto'); // Your domain web property code here
ga('send', 'pageview', {'page': '/PageName}); // Unique page virtual name

</script>
<!-- End Google Analytics -->

 

And then use the PageName assigned in this code when I construct my goal?

 

If someone can please confirm, that would be excellent!

 

Thanks!

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Tanya W
September 2016

Re: Help with Goal setup across multiple domains

Top Contributor
# 2
Top Contributor
Hi,

in essence yes - if you override the default page value with a custom one and use that value in the destination goal type setup all should work fine.

Please note that if you are in fact crossing domains inside one session and you track all this data inside one single Google Analytics property property (e.g. UA-XXXXXXXX-1) you would definitely need to add support for cross domain tracking so that the cookie information (client id) is passed on throughout the session when crossing from one domain to another. More info can be found here - https://support.google.com/analytics/answer/1034342?hl=en.

Hope it helps.

Kind regards,
Zorin
Web analyst @ escapestudio.net

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Tanya W
September 2016

Re: Help with Goal setup across multiple domains

Top Contributor
# 2
Top Contributor
Hi,

in essence yes - if you override the default page value with a custom one and use that value in the destination goal type setup all should work fine.

Please note that if you are in fact crossing domains inside one session and you track all this data inside one single Google Analytics property property (e.g. UA-XXXXXXXX-1) you would definitely need to add support for cross domain tracking so that the cookie information (client id) is passed on throughout the session when crossing from one domain to another. More info can be found here - https://support.google.com/analytics/answer/1034342?hl=en.

Hope it helps.

Kind regards,
Zorin
Web analyst @ escapestudio.net

Re: Help with Goal setup across multiple domains

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks, Zorin! Very helpful.