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

Google Analytics Cross domain tracking issue in Safari when pipe is encoded in URL

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We have noticed an increase in self-referrals lately after integrating a third party service (VWO) on our website.

The problem is that our secure cart is hosted on a different domain than our product cataloug.

Product exist on www.domain.co.uk while cart is hosted in secure.domain.com

For example, Product with ID "1234" (www.domain.co.uk/test-product-1234) would contain a link:

 

<a href="www.domain.co.uk/cart/add_product/1234"
onclick="_gaq.push(['_link', 'www.domain.co.uk/cart/add_product/1234']); return false;">Add to cart</a>

 

Our framework will then receive the following request:

domain.co.uk/cart/add_product/1234?__utma=172757925.1211331530.1462667710.1462667710.1462667710.1&__utmb=172757925.5.9.1462667721752&__utmc=172757925&__utmx=-&__utmz=172757925.1462667710.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)&__utmv=172757925.1%20I%2082.11.58.203|2=VWO-37=Leed-%2B-Product-arng.-%2B-Guest=1&__utmk=257998922

We will then preserve all Google Analytics parameters (basically each param who starts with __utm) and will PHP redirect to our secure page hosted on secure.domain.com

We have noticed that on Safari browsers the pipe symbol will be encoded into %7C Which creates a new GA visit instead of continuing the same visitor's visit flow:

secure.domain.com/cart?__utma=172757925.1211331530.1462667710.1462667710.1462667710.1&__utmb=172757925.5.9.1462667721752&__utmc=172757925&__utmx=-&__utmz=172757925.1462667710.1.1.utmcsr=(direct)%7Cutmccn=(direct)%7Cutmcmd=(none)&__utmv=172757925.1%20I%2082.11.58.203%7C2=VWO-37=Leed-%2B-Product-arng.-%2B-Guest=1&__utmk=257998922

 

Re: Google Analytics Cross domain tracking issue in Safari when pipe is encoded in URL

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆
Does the problem occur on any other browser than Safari? As I look at it, the first thing that comes to my mind is that the problem is not with a Safari and VWO but generally with passing referral information from your cart.
In my opinion your secure (https) cart does not pass referral information back to your (http) site (as it shouldn't - according to W3C standard).
When GA can't find the referral it will assign last "non-direct" source. In this case it would be your website. Hence increased number of self-referrals.