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

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

问题描述

我一直在为我公司的支持中心工作,我们需要在登录时跟踪个人用户。如果可能的话,我们也希望跟踪详细信息,例如访问的网页和在网站上花费的时间。
我可以跟踪有多少人使用自定义变量登录网站,但我无法跟踪个人用户。这里是我一直用来试图获取个人用户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){
//此逻辑块确保welcome_email元素确实存在,如果用户尚未登录,它将不存在
welcomeEmail = document.getElementById('welcome_email')。innerHTML;

$ b $ _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 )+。谷歌-analytics.com /的ga.js’;
变种S = document.getElementsByTagName(脚本)[0]; s.parentNode.insertBefore(ga,s);
})();

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

Google Analytics服务条款。见第7号私隐。


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






用户ID不是直接使用PII,如果它被用于绑定到后端系统中的某个人......这违反了服务条款。




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


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.

解决方案

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

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.

And

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 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天全站免登陆