简体   繁体   English

_setCustomVar等效于analytics.js

[英]_setCustomVar equivalent for analytics.js

ga.js中旧的_setCustomVar是否与analytics.js中的任何方法有直接对应关系?

Yes, although it depends on your needs. 是的,尽管这取决于您的需求。 It'll be one of the following: 这将是以下之一:

ga('set', 'dimensionX', 'foobar');
// OR
ga('set', 'metricY', 501);

Replace X or Y with the number... remember you now have 20 of each for the free version. 将X或Y替换为数字...请记住,免费版现在每个都有20个。 Quick and dirty difference: dimensions are the words (describes what it is) and metrics are the numbers of reports (how many / value). 快速而肮脏的区别:维度是单词(描述它是什么),度量标准是报告的数量(数量/价值)。

Also, I created a migration guide that covers most of the methods from GA -> UA. 另外,我创建了一个迁移指南 ,涵盖了GA-> UA中的大多数方法。 It should help you out! 它应该可以帮助您!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM