Google Analytics Custom variable is not working

醉酒当歌 提交于 2019-12-11 05:37:24

问题


I want to set the user details in Google analytics. I using the following syntax but it is not working to capture the use those who logged in an application.

ga('set', 'employeetype', 'permanent');
ga('set', 'employeetype', 'vendor');
ga('set', 'employeetype', 'temporary');

回答1:


You need to send the number of the custom dimension that was set up in Google analytics

ga('set', 'dimension1', 'permanent');

You can't use the name you sent that is for you Google Analytics has no understanding of it. Make sure you check Google Analytics and get the correct number corresponding to employeetype dimension (dimensions are set via the "dimension" prefix and the numerical index from the list of dimensions in the GA backend - the index more or less shows the order in which dimensions are created).

Dimensions come in different "scopes" - hit level (i.e. they are connected to every single interaction), session level (i.e. they record only the last value set during a session) and user level (i.e. they are applied to a recurring visitor). Unless you expect your employees to change their type rather often you should probably set this to user level scope (but that's a backend setting, code is the same).



来源:https://stackoverflow.com/questions/37827400/google-analytics-custom-variable-is-not-working

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