Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose you have two distinct Google Analytic accounts. How are you able to send request data to both accounts on a single page load? For example, on a normal account you'd include code such as:

var _gaq = _gaq || ["UA-12345678-1"];
_gaq.push(['_setAccount', '']);
_gaq.push(['_setDomainName', 'none']);

(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);

Could I simply include another snippet with a different UA ID? Can I pass several UA IDs in one request? Is this even possible to accomplish? Any help would be greatly appreciated!

share|improve this question

migrated from superuser.com Aug 1 '11 at 6:44

This question came from our site for computer enthusiasts and power users.

up vote 5 down vote accepted

You can use one GA snippet to send data to two different trackers. Follow the syntax below from the [Asynchronous Tracking Usage Guide][1:

  ['_setAccount', 'UA-XXXXX-1'],   //default tracker, unnamed
  ['b._setAccount', 'UA-XXXXX-2'], //second tracker, named 'b'


Additional trackers are created by giving them names and prepending the tracker name (along with a dot) in front of the method name. The example above uses the aribrary name 'b'. If a function name is qualified with the name of a tracker, it is executed on that tracker. Otherwise it is executed on the default tracker.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.