使用 Google Analytics 自定义变量跟踪个人用户 [英] Tracking Individual Users with Google Analytics Custom Variables

查看:13
本文介绍了使用 Google Analytics 自定义变量跟踪个人用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为我的公司建立一个支持中心,我们需要在用户登录时对其进行跟踪.如果可能,我们还希望跟踪详细信息,例如访问的页面和在网站上花费的时间.我可以使用自定义变量跟踪有多少人登录到该站点,但我无法跟踪单个用户.这是我用来尝试获取个人用户 ID 的代码:

I've been working on a support center for my company and we need to track individual users when they login. If possible we would like to track details as well such as pages visited and time spent on the site as well. I'm able to track how many people login to the site using a custom variable, but I am unable to track individual users. Here is the code I've been using to try to grab the individual user id:


$(document).ready( function() {
var welcomeEmail = document.getElementById('welcome_email').innerHTML;

var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-30086012-1']);

var welcomeEmail;

if( $('#welcome_email').length > 0 ) {
                //This block of logic makes sure that the welcome_email element actually exists, it will not exist if a user is not logged in yet
                welcomeEmail = document.getElementById('welcome_email').innerHTML;
}

  _gaq.push(['_setCustomVar',1,'UserEmail',welcomeEmail,1]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

我错过了什么/做错了什么.感谢任何反馈.

What am I missing/doing incorrectly. Appreciate any feedback.

推荐答案

这违反了 GoogleGoogle Analytics(分析)服务条款.请参阅第 7 项隐私.

That is a violation of Google Analytics terms of service. See number 7 PRIVACY.

7.隐私.您不会(也不会允许任何第三方)使用服务来跟踪或收集互联网用户的个人身份信息,也不会(或您会允许任何第三方)关联从您的网站收集的任何数据(或此类第三方的网站)在您使用(或此类第三方的使用)服务的过程中包含来自任何来源的任何个人身份信息.您将拥有并遵守适当的隐私政策,并将遵守与从您网站的访问者那里收集信息有关的所有适用法律.您必须发布隐私政策,并且该政策必须提供有关您使用收集匿名流量数据的 cookie 的通知.

7.PRIVACY . You will not (and will not allow any third party to) use the Service to track or collect personally identifiable information of Internet users, nor will You (or will You allow any third party to) associate any data gathered from Your website(s) (or such third parties' website(s)) with any personally identifying information from any source as part of Your use (or such third parties' use) of the Service. You will have and abide by an appropriate privacy policy and will comply with all applicable laws relating to the collection of information from visitors to Your websites. You must post a privacy policy and that policy must provide notice of your use of a cookie that collects anonymous traffic data.

虽然用户名或用户 ID 不是直接的 PII,但如果将其用于从后端系统绑定到某个人……那将违反服务条款.

While the username or user ID is not directly PII, if it is used to tie to a person from a backend system…that’s a violation of the Terms of Service.

Google Analytics 不是用于此类跟踪的工具.在您自己的服务器上托管的自定义后端解决方案是更好的方法.

Google Analytics is not the tool to use for this type of tracking. A custom backend solution that is hosted on your own servers is the better way to go.

这篇关于使用 Google Analytics 自定义变量跟踪个人用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆