谷歌分析准确吗? [英] Is Google Analytics Accurate?

查看:25
本文介绍了谷歌分析准确吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的记录显示,在 7 月 2 日至 11 月 15 日期间,我网站的特定页面被访问了 609 次.

My records show a particular page of my web site was visited 609 times between July 2 and November 15.

Google Analytics(分析)在此期间仅报告了 238 次页面浏览.

Google Analytics reports only 238 page views during that time.

我无法解释这种差异.

要让 Google Analytics(分析)跟踪页面查看事件,客户端浏览器必须启用 JavaScript 并能够访问 Google 的服务器.我怀疑 60% 的访问者要么禁用了 JavaScript,要么使用防火墙设置了到 Google 跟踪服务器的出站流量.

For Google Analytics to track a page view event, the client browser must have JavaScript enabled and be able to access Google's servers. I doubt 60% of my visitors have either disabled JavaScript or firewalled outbound traffic to Google's tracking servers.

你有什么解释吗?

我的应用程序只是在提供页面时将记录放入数据库.

My application simply puts a record into a database as it serves up a page.

它无法区分机器人查看器和人类.

It doesn't do anything to distinguish a bot viewer from a human.

推荐答案

差异几乎肯定来自爬虫.爬虫流量达到 10 倍用户流量并非闻所未闻.

The disparity is almost certainly from crawlers. It's not unheard-of for crawler traffic to be 10x user traffic.

也就是说,有一种非常简单的方法可以验证正在发生的事情:添加一个 ASPX 页面,该页面会向您网站上的每个页面发送一个不可缓存的 1x1 像素清晰 GIF 图像(又名网络错误"),并包含一个 IMG在您网站的每个页面上(例如在页眉或页脚中)引用该图像的标记.然后解析您的日志以获取对该图像的点击,查看图像调用中的查询字符串参数(例如referrer="),以便您知道网页浏览的实际 URL.

That said, there's a really easy way to validate what's going on: add an ASPX page which emits a uncacheable, 1x1 pixel clear-GIF image (aka "web bug") to every page on your site, and include an IMG tag referencing that image on every page on your site (e.g. in a header or footer). Then parse your logs for hits to that image, looking at a query-string parameter on the image call (e.g. "referrer=") so you'll know the actual URL of the pageview.

由于抓取工具和其他机器人不会提取图片(Google 图片会提取图片,但不会提取 IMG 标签中 1x1 像素的图片!),因此您将获得更准确的综合浏览量计数.在幕后,大多数分析软件(包括 Google Analytics)使用类似的方法——除了它们使用 javascript 来构建图像 URL 并动态发出图像请求.但是,如果您使用 Fiddler 观看在使用 Google Analytics 的网站上发出的 HTTP 请求,您将看到返回的 1px GIF来自 www.google-analytics.com.

Since crawlers and other bots don't pull images (well, Google Images will, but not images sized as 1x1 pixel in the IMG tag!), you'll get a much more accurate count of pageviews. Behind the scenes, most analytics software (including Google Analytics) uses a similar approach-- except they use javascript to build the image URL and make the image request dynamically. But if you use Fiddler to watch HTTP requests made on a site that uses Google Analytics, you'll see a 1px GIF returned from www.google-analytics.com.

数字不会完全对齐(例如,通过后退按钮快速取消导航的用户可能下载了一张图片,但没有下载另一张图片),但您应该会看到大致可比较的结果.如果没有,那么您可能没有在所有页面上正确设置 Google Analytics.

The numbers won't line up exactly (for example, users who quickly cancel a navigation via the back button may have downloaded one image but not the other) but you should see roughly comparable results. If you don't, then chances are you don't have Google Analytics set up correctly on all your pages.

这是说明该技术的代码示例.

Here's a code sample illustrating the technique.

在您的标题中(注意随机数以防止缓存):

In your header (note the random number to prevent caching):

<img src="PageviewImage.aspx?rand=<%=new System.Random().NextDouble( )%>&referer=<%=Request.UrlReferrer==null ? "" : Server.HtmlEncode(Request.UrlReferrer.ToString()) %>"
  width="0" height="0" hspace="0" vspace="0" border="0" alt="pageview check">

图像生成器,PageviewImage.aspx :

The image generator, PageviewImage.aspx :

private void Page_Load(object sender, System.EventArgs e) 
{ 
    Response.ContentType="image/gif";
    string filepath = Server.MapPath ("~/images/clear.gif");
    Response.WriteFile(filepath);
}

顺便说一句,如果您需要图像文件本身,请从 这里.

BTW, if you need the image file itself, do a Save As from here.

这当然不能替代像谷歌这样的真实"分析系统,但如果你只是想交叉检查,上面的方法应该没问题.

This is of course not a substitute for a "real" analytics system like Googles, but if you just want to cross-check, the approach above should work OK.

这篇关于谷歌分析准确吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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