如何使用 Google Analytics 或其他服务跟踪所有登录网络应用程序(数据库由外部公司维护)的用户?是的,我研究过,研究过。我不是一个优秀的开发人员,我有以下 Google 分析代码来跟踪常规网络分析:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXX-2', 'auto');
ga('send', 'pageview');
</script>
我有一个登录表单,输入的 ID 只是“电子邮件”。我有一个提交按钮。请帮忙。请注意,我已经查看了 Google Analytics 提供的文档,但我只是愚蠢地无法理解。
最佳答案
遗憾的是,如果您通过 GA 收集用户的电子邮件地址,那么您收集个人身份信息是否违反了 Google Analytics(分析)服务条款。请仔细阅读:https://support.google.com/analytics/answer/2795983?hl=en 。特别是,它说
The Google Analytics terms of service, which all Google Analytics customers must adhere to, prohibits sending personally identifiable information (PII) to Google Analytics (such as names, social security numbers, email addresses, or any similar data), or data that permanently identifies a particular device (such as a mobile phone’s unique device identifier if such an identifier cannot be reset), even in hashed form. Your Google Analytics account could be terminated and your data destroyed if you use any of this information.
您可能需要寻找另一种在不收集个人信息的情况下跟踪用户的方法。
或者,您也可以使用 Universal Analytics 提供的新用户 ID 功能。 https://support.google.com/analytics/answer/3123666?hl=en
关于javascript - 通过用户 ID 跟踪用户登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25922127/