Google Analytics Configuration Mistake #3: Third Party Domains

One of Google Analytics’ great features is that it can track visitors across multiple domains. This is especially handy for all those folks using a third party shopping cart. Getting GA configured correctly to work with a third party domain is not overly complicated but there can be some issues.

Here’s my list of the top mistakes made when working with a third party domain:

1. Missing GA tracking code

This is a simple step that many people forget. Make sure that you add the GA tracking code to all the pages on both domains. If the code is missing then the visitor will not be tracked. If the third party site does not allow you to add JavaScript to the pages then you may be out of luck.

Remember, the JavaScript code snippet needs to be modified slightly to look like this:




Don’t forget to replace “UA-XXXX-X” with your GA account number.

2. Missing __utmLinker() or __utmLinkPost()

The technology that GA uses to track visitors between multiple domains depends on two JavaScript functions: __utmLinker() and __utmLinkPost(). Both functions are included in the urchin.js tracking code. These functions transfer the GA tracking cookies from one domain to another via the URL. This is vital to identifying unique visitors and connecting which marketing activities lead to conversions.

Why do we need to transfer cookies between domains? Well, that’s a bit complicated and pretty technical. Think of it this way. Each visitor has their own set of cookies. For security reasons, we need a mechanism to transfer the cookies from one domain to the other. __utmLinker() and __utmLinkPost() are the mechanisms we use to transfer the cookies from one domain to another.

If you move visitors from one domain to another using regular links then you need to modify those links with the __utmLinker() function. Here’s an example:






If you move visitors between domains using a form, then you need to modify said form using __utmLinkPost(), like this:

How do you know if you’ve done it right? Go to your site and click on a link or form that drives the visitor from your site to the third party site. When you arrive on the third party site look at the URL in your browser’s location bar. You should see information like this:


http://www.cutroni.com/blog/index.htm?
__utma=var1&__utmb=var2&__utmc=var3&__utmv=var4&utmz=var5&__utmk=1232

The query string variables are the actual tracking cookies from the original domain. __utmLinker or __utmLinkPost placed them in the URL. When the visitor arrives on the third party site the urchin.js JavaScript will pluck them from the URL and create a set of cookies for the third party domain using the values from the URL.

3. Incompatible Architectures

If you’re banging your head against the monitor trying to figure out why GA is not working with a third party domain it could be that the third party site is not compatible with Google Analytics. This is very common.

First, the third party provider must let you add JavaScript to your pages. We discussed this above. No JavaScript tracking code, no visitor tracking.

Second, make sure the third party site lets you pass data to their site via the URL. Remember, that’s how __utmLinker() and __utmLinkPost() work. I’ve come across many third party sites that strip out query string variables which breaks the GA tracking.

To determine if the third party site is stripping out the query string variables use the method I described above. Go to your site and click on a link or form that drives the visitor from your site to the third party site. When you arrive on the third party site look at the URL in your browser’s location bar. You should see information like this:


http://www.cutroni.com/blog/index.htm?
__utma=var1&__utmb=var2&__utmc=var3&__utmv=var4&utmz=var5&__utmk=1232

The query string variables above (bolded) are the actual tracking cookies from the original domain.

If the third party provider’s architecture does not appear to be compatible with GA give them a call. Sometimes they’re willing to change. I’ve actually worked with quite a few vendors to help make their systems GA compatible.

Be Sociable, Share!

    Like this post? Sign up to get posts delivered to your inbox.

    Comments

    1. bB says

      I am really banging my head against a brick wall on this one.. perhaps someone here can help.

      I have a form posting to a 3rd party site and have followed the configuration instructions to track across domains… the URL that the form posts to on the 3rd party domain contains all the __utma, __utmb…__utmz variables, but the __utma and __utmz cookies that get set are different — the __utmz cookie that gets set on the third party site indicates that I am being referred by my main website.

      Any ideas where I should start looking to sort this?

    2. says

      Hi bB,

      If you can see the cookies in the URL when you land on the new site then things should work. I would check to make sure that both sites are using the same version of the tracking code. You could run into trouble if one site is using urchin.js and ga.js.

      Hope that helps,

      Justin

    3. Padma says

      Hi

      I was just wondering if anybody knows anything about posting data on google analytics without using javascripts. Any advice would be greatly appreciated.

      Thanks a lot for your time.

      Padma.

    4. says

      Hi Padma,

      Right now the only way to get data into GA is via the JS code. So you need to execute JS to send data to Google.

      If you figure out away to get JS to execute at the sever level let me know!

      Justin

    5. David says

      I’m looking at moving my blogspot blog to my own domain.

      e.g.: myblog.blogspot.com -> blog.myblog.com

      Blogspot automatically redirects all requests for the old domain to the new one, so all traffic will come from the one domain. I’d like to keep my old stats after the move.

      Do I still need to make changes to the GA tracking code (domain name to “none” and turning on linker)? Or will the old code still work even though it is being called from a different domain? (I understand the returning visitors etc. will be out because the cookie will change.)

      Regards,
      David

    Trackbacks

    1. Tracking Multiple Domains

      Justin Cutroni has yet another great series of articles over at his blog, all about common Google Analytics configuration mistakes. His most recent post discusses third party domains, and getting Google Analytics to track across them. As usual, it’s w…

    Leave a 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=""> <s> <strike> <strong>