![](/img/trans.png)
[英]What is the legacy ga.js equivalent of this analytics.js function?
[英]GA Tracker Names in new analytics.js
大家好,所以我需要在Google Analytics(分析)中設置跟蹤器名稱,然后才能在舊ga.js中擁有:
_gaq.push(['TrackerFoo._setAccount', 'UA-xxxxxxxx-1']);
_gaq.push(['TrackerFoo._setDomainName', 'sub.domain.com']);
在新的analytics.js中,我有一個send和create方法:
ga('create', 'UA-xxxxxxxx-1', 'domain.com');
ga('send', 'pageview');
如何在新的analytics.js中為setAccount,setDomain和其他設置TrackerFoo? 我用Google搜索並搜索了Google文檔,卻一無所獲,有人知道如何處理嗎?
下面顯示了“ TrackerFoo”的命名空間
_gaq.push(['TrackerFoo._setAccount', 'UA-xxxxxxxx-1']);
_gaq.push(['TrackerFoo._setDomainName', 'sub.domain.com']);
在analytics.js中,這相當於:
ga('create', 'UA-xxxxxxxx-1', 'domain.com', {'name': 'TrackerFoo'});
ga('TrackerFoo.send', 'pageview');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.