Reputation: 6627
https://developers.google.com/analytics/devguides/collection/gajs/?hl=pl#MultipleCommands
_gaq.push(
['_setAccount', 'UA-XXXXX-1'],
['_trackPageview'],
['b._setAccount', 'UA-XXXXX-2'],
['b._trackPageview']
);
in this code snippet, there is a ".b". Where is the ".b" come from? How should I use it?
Upvotes: 1
Views: 112
Reputation: 26706
If you only have one account, you don't have to use anything:
_gaq.push(["_setAccount", ......]);
From there, if you use any more accounts, you give each one a name (any name that's valid in JS), and call its instructions like name._doThing
.
You could track 8 accounts if you wanted - they just need 8 unique names, and you need to _setAccount
each one to a different Google account.
Our company chose to use primary
and secondary
-- we even give the first account a name.
Upvotes: 2
Reputation: 163602
The b
is simply specified by Google as a way to indicate how to group commands. I'd imagine you can use any string there. You don't need to worry about it... just be consistent in what you use.
Upvotes: 1