生成 Google Analytics 事件(__utm.gif 请求)服务器端 [英] Generate Google Analytics events (__utm.gif requests) serverside

查看:25
本文介绍了生成 Google Analytics 事件(__utm.gif 请求)服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我愿意使用 Google Analytics 来跟踪有关我的客户端/服务器应用程序使用情况的统计信息(用户计算机上没有浏览器!).

所以我想是否有人尝试从服务器端代码制作对 __utm.gif 的请求.

我在 google 网站,但没有关于utmcc"变量中传递的 cookie 值的详细信息.

我了解我将无法制作"分析服务器从请求本身中获取的某些信息(一劳永逸:源 IP 地址!).我无法从客户端计算机生成请求.

有没有人有这种情况的经验?任何详细信息或资源?任何有效的代码片段(任何语言都可以!:)?

解决方案

最近我问了一个类似的问题,有人给了我一个链接,我在同一个站点找到了另一个:

http://www.vdgraaf.info/wp-content/uploads/image-url-explained.txt
http://www.vdgraaf.info/wp-content/uploads/urchin-image.txt(包含在此处)

Google 的分析代码以 JS 库 ga.js 的形式提供.当从此库中调用跟踪函数时,会向 GA 服务器上以下任一 URL 的 gif 文件发出请求:

<前>http://www.google-analytics.com/__utm.gif//来自 http 页面https://ssl.google-analytics.com/__utm.gif//来自https页面

以下是请求中可能使用的参数,用于向 GA 提供详细信息:

?utmwv=1//Urchin/Analytics 版本&utmn=634440486&utmcs=UTF-8//文档编码&utmsr=1440x900//屏幕分辨率&utmsc=32-bit//颜色深度&utmul=nl//用户语言&utmje=1//启用java&utmfl=9.0%20%20r28//闪光&utmcr=1//回车&utmdt=Linklove » 最佳关键词密度//文档标题&utmhn=www.vdgraaf.info//文档主机名&utmr=http://www.google.nl/search?q=seo+optimal+keyword+density&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_nlNL210NL211//referer URL&utmp=/the-optimum-keyword-density.html//文档页面网址&utmac=UA-320536-6//谷歌分析账户&utmcc=//cookie 设置__utma=21661308.//cookie 编号1850772708.//2147483647下的数字1169320752.//时间(20-01-2007)cookie第一组1172328503.//时间 (24-02-2007) cookie 上一组1172935717.//时间(03-03-2007)今天3;+__utmb=21661308;+//曲奇号__utmc=21661308;+//曲奇号__utmz=21661308.//cookie 编号1172936273.//时间(03-03-2007)今天3.2.utmccn=(有机)|//utm_campaignutmcsr=谷歌|//utm_sourceutmctr=seo+优化+关键字+密度|//utm_termutmcmd=organic;+//utm_medium

请记住,&utmcc 值需要经过 URL 编码.


事实证明,此答案中的链接有点不可靠,因此这里有一些其他可能有用的资源:

I am willing to use Google Analytics to track stats about usage of my Client/Server application (no Browser on the user computer!).

So I guess if anyone ever tried to craft requests to __utm.gif from serverside code.

I have found some information on the request and relevant cookies at google website but there are no details on the cookies values passed in the "utmcc" variable.

I understand that I will not be able to "craft" some of the information which Analytics server derives from the request itself (one for all: the source IP address!). I can't generate requests from the Client computer.

Does anyone have experience with this scenario? Any detailed information or resource? Any working code snippet (any language will do! :)?

解决方案

I asked a similar question recently and somebody gave me a link, and I found another from the same site:

http://www.vdgraaf.info/wp-content/uploads/image-url-explained.txt
http://www.vdgraaf.info/wp-content/uploads/urchin-image.txt (included here)

Google's Analytics code is provided in the form of a JS library, ga.js. When a tracking function is called from this library, a request is made to a gif file on the GA servers at either of the following URLs:

http://www.google-analytics.com/__utm.gif //from http pages
https://ssl.google-analytics.com/__utm.gif //from https pages

The following are parameters that may be used in the request to provide GA with detailed information:

?utmwv=1 //Urchin/Analytics version
&utmn=634440486
&utmcs=UTF-8 //document encoding
&utmsr=1440x900 //screen resolution
&utmsc=32-bit //color depth
&utmul=nl //user language
&utmje=1 //java enabled
&utmfl=9.0%20%20r28 //flash
&utmcr=1 //carriage return
&utmdt=Linklove » The optimum keyword density //document title
&utmhn=www.vdgraaf.info //document hostname
&utmr=http://www.google.nl/search?q=seo+optimal+keyword+density&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_nlNL210NL211 //referer URL
&utmp=/the-optimum-keyword-density.html //document page URL
&utmac=UA-320536-6 //Google Analytics account
&utmcc= //cookie settings
    __utma=
                    21661308. //cookie number
                    1850772708. //number under 2147483647
                    1169320752. //time (20-01-2007) cookie first set
                    1172328503. //time (24-02-2007) cookie previous set
                    1172935717. //time (03-03-2007) today
                    3;+
    __utmb=
                    21661308;+ //cookie number
    __utmc=
                    21661308;+ //cookie number
    __utmz=
                    21661308. //cookie number
                    1172936273. //time (03-03-2007) today
                    3.
                    2.
        utmccn=(organic)| //utm_campaign
        utmcsr=google| //utm_source
        utmctr=seo+optimal+keyword+density| //utm_term
        utmcmd=organic;+ //utm_medium

Remember that the &utmcc values need to be URL encoded.


The links in this answer have proven to be a little unreliable, so here are some other resources that might be useful:

这篇关于生成 Google Analytics 事件(__utm.gif 请求)服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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