简体   繁体   English

使用客户端ID获取用户信息

[英]Getting user info using Client ID

I have inserted the analytics.js tracking script into my code, and now I am trying to get user data such as medium, source, etc. using javascript and putting them into variables. 我已经将analytics.js跟踪脚本插入了我的代码中,现在我正尝试使用javascript获取用户数据(例如媒介,来源等)并将其放入变量中。 Is there a way I can do this using Client Id? 有没有一种方法可以使用客户ID进行此操作?

I assume you mean getting the data in realtime for use in your website. 我认为您的意思是实时获取数据以在您的网站中使用。 That is not possible. 这是不可能的。

Client ID is not exposed in the interface by default, you'd need to use a custom dimension. 默认情况下,客户端ID不会在界面中显示,您需要使用自定义维度。

There is a processing delay, report data may only be reliable the next day. 处理上有延迟,报告数据可能仅在第二天才是可靠的。

While there is the (less reliable) data from the real time API (which at least contains medium and source information) it does not support custom dimension, so you could not use the client id as query key. 尽管有来自实时API的(可靠性较差)数据(至少包含中等和源信息),但它不支持自定义维度,因此您不能将客户端ID用作查询键。

Also to retrieve data from the API you need to be authenticated, which the current users of your webpage is not. 另外,要从API检索数据,您需要进行身份验证,而网页的当前用户则不需要。 So you would need to set up some kind of serverside proxy that handles authentication for you. 因此,您需要设置某种为您处理身份验证的服务器端代理。

Also there are API limits determining how many requests you can make in a given time frame. 还有API限制,确定在给定时间范围内可以发出多少个请求。 Even a small site would exhaust those requests pretty quickly. 即使是小型站点,也会很快耗尽这些请求。

So while in theory this sounds doable it is not actually feasible for any real-life purpose. 因此,虽然从理论上讲这听起来可行,但实际上对于任何现实目的而言都是不可行的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM