https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced
Working with Multiple Tracking Objects
In some cases you might want to send data to multiple web properties from a single page. This is useful for sites that have multiple owners overseeing sections of a site; each owner could view their own web property.
To solve this, you must create a tracking object for each web property to which you want to send data:
ga('create', 'UA-XXXX-Y', 'auto');
ga('create', 'UA-12345-6', 'auto', {'name': 'newTracker'}); // New tracker.
Once run, two tracker objects will be created. The first tracker will be the default tracking object, and not have a name. The second tracker will have the name of newTracker
.
To send a pageview using both trackers, you prepend the name of the tracker to the beginning of the command, followed by a dot. So for example:
ga('send', 'pageview');
ga('newTracker.send', 'pageview'); // Send page view for new tracker.
Would send a pageview to both default and new trackers.
To access a tracker object by name within a function, you use the getByName
method:
ga(function() {
var newTracker = ga.getByName('newTracker');
});
To get an array of all the trackers that have been configured, use the getAll
method:
ga(function() {
var allTrackers = ga.getAll();
});
Working with Multiple Tracking Objects 부분
'google analytics ' 카테고리의 다른 글
구글 디버그 툴 (0) | 2015.10.14 |
---|---|
구글분석 보고서 계정추가 (0) | 2015.10.13 |
_ga 함수 관련 (0) | 2015.10.08 |
구글 분석 전자상거래 설정하기 (0) | 2015.09.25 |
구글 애널리스틱 교육 주소 (0) | 2015.08.25 |