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

Cross Domain Tracking - Cookie String Breaking Navigation

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi All,

 

We recently implemented cross domain tracking on our website and are having some issues associated with the "?_ga=" cookie string. When clicking from our homepage to our Wordpress blog, /?_ga=XXXXXXXXXX gets appended to the end. However, once on the blog, if you try and to go to page 2, you get a url that looks like http://blogs.website.com/?_ga=XXXXXXXXXXpage/2/. This fails because the blogs reads this as the primary page instead of page 2. 

 

Any thoughts on how to fix this?

 

Thanks in advance.

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Scott M
November 2015

Re: Cross Domain Tracking - Cookie String Breaking Navigation

Top Contributor
# 4
Top Contributor
Hey Scott, yeah, just remove the auto link domains, but only if you are not cross domains. Or if you need that there in case you do in fact cross domains, then you need to change the {{cross domains}} variable into a custom JS variable. The logic would be to check to see if it's it not an associated domain, then to set the domain, otherwise send an empty string (or something like that). The same thing for the AllowLinker parameter. Use custom logic to determine if it's true or false.

Let me know if you have any more questions.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

View solution in original post

Re: Cross Domain Tracking - Cookie String Breaking Navigation

Top Contributor
# 2
Top Contributor
Hi Scott, if you are tracking across sub-domains, like from www.website.com to blog.website.com, then you shouldn't require cross-domain tracking. UA will automatically handle subdomain tracking without needing to modify code. If, however, you are crossing domains, then you will need to review how you're implementing it. It's strange how it's being appended to the middle of the URL.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: Cross Domain Tracking - Cookie String Breaking Navigation

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Nicky,

Thanks so much. Any thoughts on how I can stop the cross domain cookie from being appended when clicking within the domain?

I currently have Cross Domains setup as a filter in GA and on my analytics tag in GTM, I have the following key field set:

AllowLinker: true
cookieDomain: auto
Auto LInk Domains: {{cross domains}}
Marked as Best Answer.
Solution
Accepted by topic author Scott M
November 2015

Re: Cross Domain Tracking - Cookie String Breaking Navigation

Top Contributor
# 4
Top Contributor
Hey Scott, yeah, just remove the auto link domains, but only if you are not cross domains. Or if you need that there in case you do in fact cross domains, then you need to change the {{cross domains}} variable into a custom JS variable. The logic would be to check to see if it's it not an associated domain, then to set the domain, otherwise send an empty string (or something like that). The same thing for the AllowLinker parameter. Use custom logic to determine if it's true or false.

Let me know if you have any more questions.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: Cross Domain Tracking - Cookie String Breaking Navigation

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Awesome!

Thanks a ton.

Scott

Re: Cross Domain Tracking - Cookie String Breaking Navigation

Top Contributor
# 6
Top Contributor
Sorry, just some minor edits:

Hey Scott, yeah, just remove the auto link domains field and the allowLinker field, but only if you are not crossing domains. Or if you need those there in case you do in fact cross domains, then you need to change the {{cross domains}} variable into a custom JS variable. The logic would be to check to see if it's an associated domain, then to set the domain, otherwise send an empty string (or something like that). The same thing for the AllowLinker parameter. Use custom logic to determine if it's true or false.

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: Cross Domain Tracking - Cookie String Breaking Navigation

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Hey Nicky,

Do you have any examples of what the custom JS code should look like?

I am crossing domains in some cases. I have 3 different ones currently.

Thanks
Scott