Google Analytics是否准确? [英] Is Google Analytics Accurate?

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

问题描述

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

Google Analytics在此期间仅报告238次网页浏览量。



我无法解释这种差异。

为了让Google Analytics跟踪页面查看事件,客户端浏览器必须启用JavaScript并能够访问Google的服务器。我怀疑我的访问者中有60%已经禁用了JavaScript或防火墙出站流量到Google的跟踪服务器。



您有任何解释吗?

更多信息



我的应用程序简单地将记录放入数据库,因为它提供了一个页面。



它没有做任何事情来区分一个bot的观众和一个人。

解决方案

差距几乎可以确定来自抓取工具。爬行者流量为10x用户流量并不是闻所未闻的。这就是说,有一个非常简单的方法来验证发生了什么:添加一个ASPX页面,该页面发出一个不可缓存的1x1像素清晰GIF图像(又名web bug )到您网站上的每个页面,并在您网站的每个页面(例如页眉或页脚)中包含一个引用该图像的IMG标记。然后解析日志以查看该图片的点击率,查看图片调用中的查询字符串参数(例如referrer =),以便您知道该网页浏览的实际网址。



由于抓取工具和其他漫游器不会拉取图片(当然,Google图片可以,但IMG标签中的图片尺寸不会超过1x1像素!),您会看到更精确的浏览量。在幕后,大多数分析软件(包括Google Analytics)都使用类似的方法 - 除了他们使用JavaScript来构建图像URL并动态地创建图像请求。但是,如果您使用 Fiddler 观看使用Google Analytics的网站上发出的HTTP请求,则会看到一个1像素的GIF返回来自www.google-analytics.com。



这些数字不会完全对齐(例如,通过后退按钮快速取消导航的用户可能已经下载了一个图像但不是其他),但你应该看到大致相当的结果。如果您不这样做,那么很可能您没有在所有网页上正确设置Google Analytics。



下面是一个说明这种技术的代码示例。

在头文件中(注意防止缓存的随机数) :

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

图片生成器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);
}

顺便说一句,如果你需要图像文件本身, a href =http://c.microsoft.com/trans_pixel.asp?source=msdn&TYPE=PV =noreferrer>这里。

这当然不能代替像Google这样的真实分析系统,但如果您只是想交叉检查,上述方法应该可以正常工作。 / p>

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

Google Analytics reports only 238 page views during that time.

I can't explain this discrepancy.

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.

Do you have any explanation?

More Info

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.

解决方案

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

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.

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.

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">

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.

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

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