Google Analytics Multiple Custom Dimension

◇◆丶佛笑我妖孽 提交于 2019-12-22 19:44:33

问题


I am working on Google Analytics chart on my site and in the tracking code I want two add two custom dimension (One is a User ID). I am doing it this way, am I doing it right ? ga('create', 'UA-XXXX', {'userId': spUserId}); ga('set', { 'dimension1': spUserId, 'dimension2': jobAidId }); ga('send', 'pageview');


回答1:


Yes, that's correct:

ga('set', {'dimensionX': valueX, 'dimensionY': valueY, 'dimensionZ': valueZ});
ga('send','pageview');

You could also send them with other hits too:

ga('set', {'dimensionX': valueX, 'dimensionY': valueY, 'dimensionZ': valueZ});
ga('send','event', 'cat', 'action', 'label');


来源:https://stackoverflow.com/questions/32099708/google-analytics-multiple-custom-dimension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!