问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
