Google Analytics - 将用户 ID 与我网站的帐户 ID 匹配 [英] Google Analytics - Match UserID with my site's account ID
问题描述
我的每个注册客户都有唯一的帐户 ID(例如:代理编号:00173393).
我想通过谷歌分析检索此信息...这不是个人信息,仅供统计使用.
我实现了用户 ID,但是如何匹配用户 ID 和帐户 ID?
是否可以为帐户 ID 编号创建变量?
为什么不将 account ID
也用作 User ID
?这样你就会有一对一的匹配:
ga('create', 'UA-XXXXX-Y', 'auto', {用户 ID:帐户 ID});
但请注意,用户 ID
不会被 Google Analytics 公开.如果您想检索它,您需要将其保存在
或API
Each of my registered clients have an unique account ID (eg: agent n°: 00173393).
I want to retrieve this information through google analytics... It's not a personal information and for statistics use only.
I implemented userID, but how to match userID and the accounts IDs ?
Is it possible to create a variable for the account ID number ?
Why don't you use the account ID
as User ID
as well? That way you would have a 1-to-1 match:
ga('create', 'UA-XXXXX-Y', 'auto', {
userId: accountId
});
Please note however that the User ID
is not exposed back by Google Analytics. If you want to retrieve it, you need to save it inside a custom dimension:
- Admin -> Property -> Custom Dimensions -> Create one with User scope
- Add custom dimension tracking to your code
For instance:
ga('create', 'UA-XXXXX-Y', 'auto', {
userId: accountId,
});
ga('set', 'cd1', accountId); // if it's custom dimension n1
ga('send', 'pageview');
Then you can retrieve the User ID
via the UI:
or the API
这篇关于Google Analytics - 将用户 ID 与我网站的帐户 ID 匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!