Tagging for Multiple Google Analytics Profiles

0 Share35

Tagging for Multiple Google Analytics Profiles

It appears to be a fairly common practice to tag a web site to send data to multiple Google Analytics profiles. However, if done incorrectly, it could result in significant errors ...

It appears to be a fairly common practice to tag a web site to send data to multiple Google Analytics profiles. However, if done incorrectly, it could result in significant errors in your data, and significantly impact analysis on the whole.

This was recently the case with a client of mine (who shall remain anonymous). They tried to implement the new “analytics.js” tracking (over the older “ga.js”) on a redesigned site they did for a client of theirs. They also wanted to send data to three different Google Analytics profiles, as requested by their client.

Here is the code they used:

(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 ga('create', 'UA-421xxxxx-x', 'domain.com'); ga('send', 'pageview');
 ga('create', 'UA-329xxxxx-xx', 'domain.com'); ga('send', 'pageview');
 ga('create', 'UA-286xxxxx-x', 'domain.com'); ga('send', 'pageview');

The problem with this code is primarily, it’s sending all three pageview calls to the first Google Analytics profile, UA-421xxxxx-x. So some of the traffic data on that profile was now corrupted. The pageviews were tripled, the bounce rate, time on site, and any path reports (like Visitors Flow) were completely inaccurate.

Don’t let this happen to you – if you are going to use the new “analytics.js” tagging method and you wish to send data to multiple profiles, here is the correct way to write your code:

(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 ga('create', 'UA-421xxxxx-x', 'domain.com');
 ga('create', 'UA-329xxxxx-xx', 'domain.com', {'name': 'b'});
 ga('create', 'UA-286xxxxx-x', 'domain.com', {'name': 'c'});
 ga('send', 'pageview');
 ga('b.send', 'pageview');
 ga('c.send', 'pageview');

For more details on this tagging solution, please refer to the Google Analytics Developers Guide.

Gabriele has been doing "Web Stuff" since the mid-1990s, and Web Analytics since 2005. She began with Omniture SiteCatalyst (now known as Adobe Analytics) and is now also well versed in Google Analytics. She has been building a team of professional analysts who have expertise in all the major analytics platforms, including Adobe Analytics, Google Analytics, IBM Coremetrics and WebTrends.