Pitfalls Of Tracking To Multiple Accounts In Google Analytics
Tracking to multiple accounts? What’s that?
When you create a GA account, you get an account number starting with “UA-” followed by a string of digits. When you put the GA Tracking Code on your pages you must specify what account you want it to send the data to by including this account number. If you want to send that data to multiple accounts you need to duplicate portions of the Tracking Code and include both account numbers:
Above we see two lines duplicated with different UA numbers. The data for the page that includes this code will be sent first to the account UA-11111-1 and then to the account UA-22222-1.
But when you do this there is the possibility that you may not get what you think you’ll get.
Using this method, the same cookies are used for both keeping tracking of information sent to both accounts. This opens the door for some potential problems.
1. Non-Identical Code
Some things you can do with the GA code can cause it to write cookies in different formats. If this happens GA can get a little confused. Okay, a lot confused. Here’s an example that will cause you you problems:
In the above code, the first tracker includes the lines to allow for Cross-domain tracking in GA. This means that the first set of code will try to write cookies in one format, but the second set of code will try to use a different format.
Using Cross-domain tracking is fine, but you have to make sure that the code is the same for both trackers. If you do it in one, make sure you put the same lines into any additional trackers.
2. Different Pages
Another problem you can encounter is not having the Tracking Code on all the same pages. That is, some pages are tracked to both accounts, while others are only tracked to one account.
The problem here is, again, that the same cookies are being used. So, I view a page that is only tracked to Account A, and then view a page that is tracked to both Account A and Account B. The Account B code will see the cookies that were originally created by a page that had No Account B tracking code. The first pageview recorded to Account B will have referral information created on a different page. It will think this is the second pageview, etc.
So, make sure the same code is on all the same pages for consistent tracking.
3. User Defined Segments
The User Defined Segment value is stored in a cookie (__utmv). Since both sets of code are using the same cookies, once you set a User Defined Segment for one, you’ve set it for the other as well. You can’t have one set of User Defined Segments for the first set of code, and another set of User Defined Segments for the second set of code.
For example, you can’t use the first set to keep track of Member/Non-member and the second set to keep track of Male/Female because they will overwrite each other.
In this example, because of the way that GA handles _setVar, when the visitor comes back for a second visit he will be classified as “Male” in both accounts.
These are some of the most common issues I’ve seen when troubleshooting these types of implementations. Hope this gives you some things to look out for, and if you have any questions, feel free to use the comments to ask.