I recently came across an issue where an online application was crossing several domains during the customer experience, and the Google Analytics tracking was losing the referrer when they left the originating domain.
The usual Google Analytics tracking code is:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<s cript type="text/javascript">
var tracker = _gat._getTracker("#GACode#");
tracker._setDomainName("none");
tracker._setAllowLinker(true);
tracker._initData();
tracker._trackPageview();
</script>
1<s cript type="text/javascript">
2var tracker = _gat._getTracker("#GACode#");
3 tracker._setDomainName("none");
4 tracker._setAllowLinker(true);
5 tracker._initData();
6 tracker._trackPageview();
7</script>
With the addition of two extra lines:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
tracker._setDomainName("none");
tracker._setAllowLinker(true);
1tracker._setDomainName("none");
2tracker._setAllowLinker(true);
We can force each link to carry the cookie data over to the next domain, maintaining the user data throughout.
There is one other small change. Any href that transitions from one domain to the next has to include an onclick event that tells it to use a tracker method.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<a href=http://domain.com/page.cfm onclick="tracker._link('http://domain.com/page.cfm'); return false;">Link Text </a>
1<a href=http://domain.com/page.cfm onclick="tracker._link('http://domain.com/page.cfm'); return false;">Link Text </a>
We need to do something similar to form submissions:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<form onsubmit="tracker._linkByPost(this)">
1<form onsubmit="tracker._linkByPost(this)">
In this way the user cookie is maintained across multiple domains.
There are no comments for this entry.
[Add Comment] [Subscribe to Comments]