大网数据广告活动
网站运营与故障问答

Is Google Analytics being too conservative?

· 52CE 我爱测

I wrote my own statistics logging script. It excludes a lot of bots - ie any user-agent that contains any of the following is excluded: bot spider crawl saashub owler researchscan go-http-client newsblur python-requests alittle c…

问题原文

原帖链接 · Richard · CC BY-SA 4.0

I wrote my own statistics logging script. It excludes a lot of bots - ie any user-agent that contains any of the following is excluded:

bot
spider
crawl
saashub
owler
researchscan
go-http-client
newsblur
python-requests
alittle client
hypefactors
dalvik
duckduckgo
electronic frontier foundation
lwp::simple
lenns.io
magellan
qwant
yahoo
saashub
cfnetwork
curl
facebook
montastic

I would imagine that there are lots more but not enough to make a massive impact.

Anyway - this script of mine is just a PHP function that writes a line to a logfile. The logfile is then parsed when I want to see the stats.

The thing is - it reports an awful lot more than Google Analytics did - over 2000 for my script vs a few hundred for GA. Is there something I'm missing?

已采纳解答

原帖链接 · davidgo · CC BY-SA 4.0

There could be quite a bit you are missing - but without knowing details of your script we can't say how much.

One of the key things that may largely describe the difference is that GA uses a bit of Javascript to count hits. Bots generally don't run Javascript - and there are a lot of bots not on your list.

Conversely, I don't believe Google accounts for when I visit a web page - because I have adblocking. While I am not your typical user, I am by no means unique. Your script would pick up my hit (correctly), but Google won't.

There may also be discrepancies related to caching, and what you consider a hit.

Your mileage will likely vary a lot - but I did a very quick and dirty list of agents hitting my customer home pages over the last few hours (almost all using Wordpress which will skew things quite a bit but) - and you missed a few very heavily traffic'd bots including "FreshpingBot" at over 10% of hits relative to Mozilla hits, Sogou web pider, Wordpress, Apache-HttpClient, WP Fastest Cache Preload bot, ZoominfoBot, cpp-httpli, mediatoolkitbot, webprosbot,Ruby, EPiServer Link Checker, panscient.com stood out among many others I saw not on your list.

In short, Googles results are likely more accurate then your results if you care about real users, but they likely slightly understate the number hits.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2023-11-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。