Google Analytics - multiple trackers for multiple accounts?

Maybe I'm going to do it wrong, but I hope I can get some idea. I design for several clients across the country. I track many of my sites using my personal Analytics account, which tracks all the domains / profiles that I work on. However, now I have marketing people who jump into the fray, everyone wants their own GA trackers to be installed (and some other third-party trackers, but this is inappropriate ... I think?) Who are related to their own accounts.

So, I saw some discussion regarding entering multiple trackers into the code (and the possibility of corrupt cookies and data). Just, is there a better way I could do this? I would prefer to leave them outside my account, so if any relationship can be saved, historical data can be saved.

Did I miss something?

Thank!

+19
google-analytics
Aug 12 '09 at 7:06
source share
5 answers

There may be several trackers on one site, for example:

<script type="text/javascript"> var trackerA = _gat._getTracker("UA-XXXXXXX-X"); trackerA._initData(); trackerA._trackPageview(); var trackerB = _gat._getTracker("UA-XXXXXXX-X"); trackerB._initData(); trackerB._trackPageview(); </script> 

Another option is to link multiple Google accounts to one Google Analytics account (using the User Manager link in the GA account overview).

+16
Aug 12 '09 at 7:12
source share
β€” -

Now it’s easier with the new asynchronous tracking code. :)

http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html#MultipleTrackers

+9
Jan 6 '10 at
source share

From asynchronous api documentation

Pressing commands on multiple trackers also works.

 _gaq.push( ['_setAccount', 'UA-XXXXX-1'], ['_trackPageview'], ['b._setAccount', 'UA-XXXXX-2'], ['b._trackPageview']); 
+5
Jan 10 2018-12-12T00:
source share

This also works for invoking several _trackPageviews after loading the page (for additional recorded actions, such as tracking when someone uploads a PDF file)

 <script type="text/javascript"> var ua_codes = ['UA-XXXXX-1', 'UA-XXXXX-2', 'UA-XXXXX-3'] var _gaq = _gaq || []; for(i in ua_codes) { _gaq.push(['_setAccount', ua_codes[i]]); _gaq.push(['_trackPageview']); } (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <a href="/some_document.pdf" onClick="record_click(this.href);">Read the pdf</a> <script type="text/javascript"> function record_click(track_url) { for(i in ua_codes) { _gaq.push(['_setAccount', ua_codes[i]]); _gaq.push(['_trackPageview', track_url]); } } </script> 
+3
Sep 19
source share

I think this is a common thing. Something is happening at the company I work for. We have GA and many other tags from marketers. We just have to live with him.

Analytics is best used by marketers.

0
Aug 12 '09 at 7:11
source share



All Articles