According to GA docs, I can issue multiple commands with a single push, however in their code snippet they do not prefix the first namespace, whereas they prefix the subsequent namespace with the letter “b”. I prefer consistency, so I opted to prefix the first namespace actions with the letter “a” like the following:
['a._setAccount', 'UA-MYACCOUNT-1'],
['a._trackPageview'],
['b._setAccount', 'UA-MYACCOUNT-2'],
['b._trackPageview']
Anyone know if there is an issue in doing this? Or should I just follow the google example and remove the “a” prefix “just to be safe”?
The only issue that I’m aware of is that without a default (unnamed) tracker, you have to make sure to use the optional name argument to _getTrackerByName().
If you don’t, a new default tracker will be created & returned, which is probably not what you expected.