Analytics
1.7K members online now
1.7K 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 Not Working - Possible Issue w/ iframe For Analytics Scripts?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Right now I cannot attribute sales which means I am flying blind, so I'd really appreciate any help I can get.  I've read a number of posts and help docs about cross domain tracking and really can't figure out what I'm doing wrong - but suspect it has to do with how SpreadShirt.com inserts tracking codes.

 

I have a blog (www.CruiseHabit.com) on which I use GA UA and everything tracks fine. On my site I have an embedded (JS, not iframe) SpreadShirt shop. That too tracks fine, as it's under the www.CruiseHabit.com domain. If you go to check out however, you're sent away from my site to checkout.spreadshirt.com. I am tracking the traffic when it gets there, but the referrer is always spreadshirt (checkout/footer, an iframe where they inject analytics code) rather than the original referrer to my session - it is a completely different session than the one the user created when they got to my site.

 

In other words, we have this flow:

1) User finds a creditcards.com article containing a link to my site, and they click it

2) I see that user's session and can see they're referred by creditcards.com

3) User goes to my shop page, and I see that same session, that they got to the shop from creditcards.com, etc

4) User goes to check out and is sent to checkout.spreadshirt.com

Actual behavior: I see a new session in the checkout, with a referrer of an iframe in the check out (again, spreadshirt puts the analytics code in an iframe)

Expected behavior: I see that same session, with a referrer of creditcards.com, now in my checkout

 

Things I've done/notes:

  • The UA code is the same for the analytics codes on my site and at Spreadshirt (for my specific shop)
  • I've set all pertinent domains to not show as a referrer
  • The analytics code on my site has a secondary domain of 100151996.spreadshirt.com, where the ifram with tracking code loads in the checkout (ga("linker:autoLink", ["100151996.spreadshirt.com"])Smiley Wink
  • The analytics code I inject into spreadshirt has a secondary domain of www.CruiseHabit.com
  • I am injecting my own analytics code into spreadshirt - they give you the option to have them do it, but the result/behavior ends up being the same.
  • I didn't include checkout.spreadshirt.com or any other domain within my tracking code because the analytics fire from that 100151... domain regardless of whether I use SpreadShirt's build in analytics script injection or my own. I've tried though, and it made no difference.
  • If you ask SpreadShirt about analytics, they tell you they can't help the second the see that a-word.

I sincerely appreciate any guidance.

Cross Domain Tracking Not Working - Possible Issue w/ iframe For Analytics Scripts?

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

So it seems the issue is that clientID is supposed to be passed, but traffic goes from my site to checkout.spreadshirt, and then the analytics fire from 100151996.spreadshirt, so even if it's passed from checkout, that doesn't matter.  Because there isn't a link or action going from cruisehabit to 100151996 I'm trying to use postMessage to send the clientID from checkout to the 100151996 iframe.  

 

This seems, in principle, the issue.  Yet I've not been able to solve it.