Often times, people forget an important and (usually) easy step when configuring their cross domain eCommerce tracking in Google Analytics. This step is referred to as the link the method. The link method sounds complicated at first, but really it is very simple.
What is the Link Method and How Does it Work
The link method is basically a piece of code provided by Google Analytics that allows you to track across domains and subdomains. This piece of code is added to the already standard code which creates an HTML hyperlink. So when you link from the main domain to a subdomain or another site to complete your checkout process, the link method wraps around the hyperlink which links from one site to another.
According to Google Analytics, “This method works in conjunction with the _setDomainName()
and _setAllowLinker()
methods to enable cross-domain user tracking. The _link()
method passes the GATC cookies from this site to another via URL parameters (HTTP GET). It also changes the document.location and redirects the user to the new URL.”
So as we can see, the link method allows the cookie to pass from one site to another through the URL parameter and redirects the user to a new URL. But all you really need to know, is that it allows you to link your eCommerce conversion tracking between the two sites.
What Do you Have to Do?
Below, please find an image that explains the link method for Google Analytics eCommerce Tracking.
As you can see, all you really need to do is take this template and fill in the correct URL and anchor text link.
<a href=”Add the Correct URL Here”
onclick=”_gaq.push([‘_link’, ‘Add the Correct URL Here‘]); return false;”>Add Your Link Text Here</a>
What Other things Need to be in Place
Outside of the link method, there are few other things that need to be correct. First, make sure when you are configuring your Google Analytics code make sure you grab the code which makes the most sense for your particular project. Please note, if you are using the new Universal Analytics tracking code that code will be different than the standard.
Last thing you will need to do is add eCommerce tracking code on the checkout page. That can be a little tricky if it is your first time. You can find all the information here on in the image below.
Good luck adding your cross domain eCommerce link method tracking code!