• Follow us on Twitter
  • Add me on Linkedin
  • RSS

  • Home
  • Services
  • Tools + Calculators
    • Google Analytics Content Targeting Generator
    • A/B/n Split Test Confidence Calculator with Graphing
    • Simple Feedback Form with Google Analytics Integration
  • About
  • Contact

Blog - Latest News

A Unique Solution to Cross-Domain Tracking in Google Analytics

1 Comment/ in Analytics / by Robert Kingston
November 23, 2010

Normally, cross domain tracking is a nightmare in Google Analytics. Transferring the cookie data from one domain to another can create nightmares for companies, especially as they have to use things like:

  • _getLinkerURL on iframes
  • _linkByPost on all forms posting users cross domain
  • _link on URLs sending users cross domain

Citricle seems to have come up with a solution (at least for sites that have their carts on a 3rd party domain name like Netsuite - but it looks simple enough to work on more complex setups). The idea is simple. To help, I’ve drawn a little diagram to explain it (seriously whipped this up in 5 minutes, certainly not winning any awards for this!):

How to set it up

All it requires are these few modifications:

1. Update your GA snippet to include the iframe creation code
2. Upload the proxy code (a blank HTML file to your site with only your GA code on it)
3. Change the value of the proxyAddress variable in the iframe creation code to the location of the proxy file on your checkout server
4. Exclude the virtual pageviews under “/tracking/citricle-ga” from your  profile URLs

Iframe creation code

This code goes at the bottom of your GA snippet:

//***********************************************************************************
// Copyright 2009 Citricle. All rights reserved.
// This script is released under the LGPL license which means you can use it or adapt it
// to your needs, improve it and distribute it freely across the web as long as you don’t remove
// this copyright notice. For technical support go to www.citricle.com.
//***********************************************************************************
var domain = "roomitup.com"; //replace this with your own domain name
try    {
if(document.URL.indexOf(domain) != -1) {
if((document.referrer.indexOf(domain) == -1)  && (document.referrer != ""))    {
var iframeElement = document.createElement("iframe");
var proxyAddress = "https://www.checkout.com/citricle-ga.html"; //replace with the location of your own shopping cart
iframeElement.setAttribute("src", pageTracker._getLinkerUrl(proxyAddress));
document.getElementById("div__header").appendChild(iframeElement);
iframeElement.style.display = "none";
}
}
}
catch(e) {};

Proxy file code (on your checkout domain)

This gets uploaded to somewhere on your checkout domain. You’ll also need to replace the value for the proxyAddress in the Iframe creation code above:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Citricle Google Analytics NetSuite Proxy</title>
</head>
<body>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-1579697-1"); //replace UA-1579697-1 with your own account #
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._initData();
pageTracker._trackPageview("/tracking/citricle-ga"); // You'll need to setup an exclude filter on your profile to exclude this URL
</script>
<p>This solution was developed by <a href="http://www.citricle.com">Citricle</a>.</p>
</body>
</html>

Citricle’s Original Post

Anyway, go on and checkout their solution for yourselves over at their GA/Netsuite Integration post.

← Conversion Optimisation for ‘Noobs’: Choosing What to Test
The Performance Impact of Google Website Optimizer MVT →
Comments

One Response to A Unique Solution to Cross-Domain Tracking in Google Analytics

  1. Ophir Prusak says:
    December 10, 2010 at 13:11

    Brilliant!

    Why didn’t I think of this before ? :)

    - Ophir

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

About Rob

I'm a freelance web analytics and optimisation specialist that helps companies make data driven decisions to improve sales, revenue or other objectives. Currently, I work with clients in education, retail, banking, energy and not for profits. Enjoy my site!

Subscribe For More Great Tips


Subscribe by RSS


Follow me on Twitter


Categories

  • Analytics
  • Conversion Rate Optimisation
  • Marketing & Consumer Insight
  • News
  • Testing

Most Popular Posts

  • Track WordPress Blog Comments in Google Analytics
  • Google Analytics’ New Site Speed Report Tracks Page Load Times
  • Build a Conversion Rate Heatmap by Hour & Day of Week in Google Docs
  • Cohorts.js: Open Source JavaScript MVT Split Testing Framework
  • Track What Visitors Copy From Your Site in Google Analytics

Recent Posts

  • A Guide to Measuring Split Tests in Google Analytics & Other Tools
  • Web Browsers Most Susceptible to Browser Fingerprinting
  • Cohorts.js: Open Source JavaScript MVT Split Testing Framework
  • 10 Sources of Direct Traffic & How To Track Direct Shares
  • Track What Visitors Copy From Your Site in Google Analytics

Blogroll

  • Analytics Ninja
  • Justin Koro
  • LunaMetrics Blog
  • Marketing Experiments
  • Mint Metrics
  • SnowPlow Analytics
  • Teacup Marketing
  • Home
  • Services
  • Tools + Calculators
    • Google Analytics Content Targeting Generator
    • A/B/n Split Test Confidence Calculator with Graphing
    • Simple Feedback Form with Google Analytics Integration
  • About
  • Contact
418Follower294Subscribers
© Copyright - Optimisation Beacon - Wordpress Theme by Kriesi.at