谷歌分析和服务器命中之间的分歧 [英] Anamoly between google analytics and server hits

查看:97
本文介绍了谷歌分析和服务器命中之间的分歧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在单页HTML5应用程序上使用Google Analytics。虽然Google Analytics显示访问量为16k,但服务器日志中的点击数表示该数字大约为3 lac。



我在头部使用以下跟踪代码我的网页:

 < script> 
(function(i,s,o,g,r,a,m){i ['GoogleAnalyticsObject'] = r; i [r] = i [r] || function(){
(i [r] .q = i [r] .q || [])。push(arguments)},i [r] .l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a,m)
})(window,document,'script' , '// www.google-analytics.com/analytics.js','ga');

ga('create','UA-xxxxxxxx-x','example.com');
ga('send','pageview');
< / script>

如果Google Analytics搜索结果正确无误,我该如何追踪此原因?使用服务器日志等)?

解决方案

我假设通过3 lac你的意思是三个十万个



首先访问GA并点击服务器日志文件不具有可比性,因为访问次数是一个总数,通常包含多个匹配。其次,服务器日志跟踪对服务器的请求(包括对图像,css文件,js文件等资源的请求以及错误页面)。由于一个页面包含多个文件(HTML和资产),每个网页浏览都会导致多次访问服务器。此外,服务器日志将跟踪漫游器和抓取工具。另一方面,Google将仅跟踪对页面本身的请求(包含跟踪代码的部分),而不会跟踪资产,并且它不会跟踪(在标准实现中)不使用JavaScript的用户代理。它也不会跟踪已选择退出跟踪的用户。



由于目前大多数网络流量都是由这类用户代理(搜索引擎爬虫等)引起的,服务器日志将显示比Google Analytics更多的流量。

要比较这两者,首先需要删除对资产文件的调用以及由日志文件中的搜寻器引起的所有流量。然后,您需要比较正确的指标(即Google Analytics网页浏览量与服务器日志点击量,而不是访问量)。


I am using Google Analytics on my single page HTML5 application. Though Google Analytics shows Visits as 16k, the number of hits in the server log says the figure is around 3 lac.

I am using the following tracking code in the head section of my page:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxxxxxx-x', 'example.com');
  ga('send', 'pageview');
</script>

What could be the reason for such anamoly or how can I track if the Google Analytics results are correct (using server logs etc) ?

解决方案

I assume that by "3 lac" you mean three hundred thousand.

First of all visits in GA and hits in a server log file are not comparable since "visits" is an aggregate number that usually includes multiple hits.

Secondly the server log tracks requests to the server (including requests for assets like images, css file, js file etc. as well as error pages). Since a page comprises multiple files (html and assets) every pageview will result in multiple hits to the server. Also the server log will track bots and crawlers.

On the other hand Google will track only the request to the page itself (the part that includes the tracking code) and not the assets, and it will no track (in the standard implementation) user agents that do not use javascript. It also won't track users that have opted out from tracking.

Since by now the majority of web traffic is caused by such user agents (search engine crawlers etc.) server logs will show significant more traffic than Google Analytics.

To compare the two you first need to remove calls to asset files and all traffic that is caused by crawlers from the log file. Then you need to compare the correct metric (i.e. Analytics pageviews vs. server log hits, not visits).

这篇关于谷歌分析和服务器命中之间的分歧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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