Is Google Analytics Accurate?

前端 未结 10 1223
春和景丽
春和景丽 2021-02-06 07:34

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.

相关标签:
10条回答
  • 2021-02-06 08:23

    Are you looking at unique page views in Analytics and total page views in your logs?

    0 讨论(0)
  • 2021-02-06 08:25

    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.

    0 讨论(0)
  • 2021-02-06 08:25

    Maybe the tracker of your web pages record every hit, even if it comes from the same IP address (same surfer hits the page twice).

    0 讨论(0)
  • 2021-02-06 08:26

    Justin's answer is very good. I would just add this as a comment but I'm lacking powerpoints :P

    One thing to keep in mind, too, when comparing analytics systems, is that there's always some discrepancy to be expected:

    The methodology of page tagging with JavaScript in order to collect visit data has now been well established over the past 8 years or so. Given a best practice deployment of Google Analytics, Nielsen SiteCensus or Yahoo Web Analytics, high level metrics remain comparable. That is, can be expected to lie between 10-20% of each other.[ link ]

    0 讨论(0)
提交回复
热议问题