Google Analytics Custom variable is not working

2019-08-01 02:18发布

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条回答
不美不萌又怎样
2楼-- · 2019-08-01 03:19

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).

查看更多
登录 后发表回答