Google analytics - How to send values for custom dimension/metrics

☆樱花仙子☆ 提交于 2020-01-04 03:55:08

问题


I'm starting with google analytics and i don't realize how make it works.

We are making a site and we want to add the user name as custom variable in google analytics in order to analyze the behavior of each user with the site.

For this, i start to use google analytics (analytics.js) a couple weeks ago and i created a custom dimension (to know who user access) and a custom metric (to know how many visits made) as it's indicated in documentation.

The dimension and metric were created with session scope because those values must be sent once per session.

After that, i add the code needed as is explained here:

ga('create', 'UA-#######-1', 'domain.com');

ga('set', {
  'dimension1': 'userName',
  'metric1': 1
});      

ga('send', 'pageview');

I've tried this code and others configurations but google analytics doesn't take the values. Look this image (http://snag.gy/Ou8vG.jpg)

What i'm doing bad? it can be because i'm sending the request with 'pageview' and the dimension is scoped with session?


回答1:


Finally worked!!

Apparently you must wait a time (like 2 days for me) before Google starts to record the information. Documentation not specified this detail.

I hope this answer helps other people with the same question!!



来源:https://stackoverflow.com/questions/17711294/google-analytics-how-to-send-values-for-custom-dimension-metrics

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