javascript - 通过用户 ID 跟踪用户登录

标签 javascript html web-services google-analytics google-analytics-api

如何使用 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/

相关文章:

java - 无法在 JAX-WS Eclipse 生成的客户端上设置自定义超时

javascript - 在 x 轴 d3.js 中显示特定数组

javascript - 当数据发生变化并且不再满足查询时自动刷新网格

javascript - 使用 JavaScriptencodeURIComponent 函数对空格进行编码

javascript - 如何让div跟随鼠标?

html - 将元素(使用 ':before' )向右对齐

c# - 发送 Soap 请求并捕获响应

javascript - 在页面中找到一串文本并在其周围包裹一些 span 标签

html - css 右栏菜单和内容向下移动

vb.net - 使用 VB.NET 客户端从 Java Web 服务获取响应