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');
标签:
google-analytics