I need to track a website with Universal Analytics in two different properties of the same account.
Following a guide here http://www.tjkelly.com/blog/google-analytics-two-tracking-codes-on-same-page-2014/ I put this as last solution:
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create','UA-xxxxxxx-1','domain.co');
ga('create','UA-yyyyyyyy-2',{'name':'b'});
ga('send','pageview');
ga('b.send','pageview');
Is this correct? It seems to work but it's pretty different from the guidelines https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#multipletrackers and