I have two google analytics tracking account.
var ga1 = "UA-XXXXXX-1";
var ga2 = "UA-XXXXXX-2";
I then create the object and send the page view.
ga('create', ga1, 'auto');
ga('send', 'pageview');
ga('create', ga2, 'auto', {'name': 'second'});
ga('second.send', 'pageview');
I then set dimension1 in the object and send the page view again.
ga('set', 'dimension1', 'mytown');
ga('send', 'pageview');
ga('set', 'dimension1', 'mytown', {'name': 'second'});
ga('second.send', 'pageview');
And then I view the result on Google Analytics.
- Both ga1 and ga2 account can detect that there's a user active on the site using real time report. (e.g.: current active user = 1)
- But, only account ga1 can record that there's a dimension1 value received on the custom report. The custom report for the same dimension on ga2 is empty whatsoever.
Why? Is there someone can point me where my code is wrong? Thanks.
This is the combined code.
var ga1 = "UA-XXXXXX-1";
var ga2 = "UA-XXXXXX-2";
ga('create', ga1, 'auto');
ga('send', 'pageview');
ga('create', ga2, 'auto', {'name': 'second'});
ga('second.send', 'pageview');
ga('set', 'dimension1', 'mytown');
ga('send', 'pageview');
ga('set', 'dimension1', 'mytown', {'name': 'second'});
ga('second.send', 'pageview');
Thanks!