Welcome to WebmasterWorld Guest from

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Google Analytics - showing less visitors then my "acces log"?

Google Analytics - showing less visitors then my "acces log"?

6:58 pm on Feb 21, 2010 (gmt 0)

10+ Year Member

I have a little php script implemented in the footer of my website, which logs every IP address that requests the page. In the footer is also the Google Analytics code.

Not much can go wrong in my iplogging script:
mysql_query("INSERT INTO stats (whatdate, ip) VALUES (NOW(),'$ip')");

Yesterday mysql showed i logged 785 unique ip's. However when I look in Google Analytics, it only shows 413 visits, a big difference!

Google Analytics is always showing like 40% less "visits", in comparison to the ip's that i logged.

Does anyone have a clue what could cause the difference?

I was thinking myself that:
- Google might not count certain ip's as visits? Maybe a lot of robots don't count?
- there is something wrong with my ip script, which seems impossible because i don't make up ip-addresses, i really log them:)
- There could be something wrong that the analytics code doesn't load for certain visitors?

Any help & ideas much appreciated!
1:37 am on Feb 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Remember, GA is Javascript based so it only counts hits from a browser with JS enabled. Your web server will count every time it serves the page.

So hits from robots, some mobile phones, or people who have internet security programs running that disable third party scripts (GA specifically can be disabled in some) won't ever execute the code that tells Google they visited your site. Also, if you've ever tried to buy traffic from sites that advertise stuff like "Get 50,000 hits guaranteed", most of those are scams that send robots out to your page and maybe follow a few links but since they aren't real browsers they don't execute JS.

Related aside, one of my sites is about 90,000+ pages and has a high enough PR and changing content that Googlebot visits every page every day. According to the server logs, the site is getting more than 6 Million hits a month. Yet according to iwebtrack (hosted analytics we use) it only gets about 1.3 million. The reason? Because the Googlebot triggers a page view on the server, but NOT in iwebtrack since iweb is javascript.

Also, I've seen Googlebot visit from over 250 unique IP's owned by Google or their upstream.
4:20 am on Feb 22, 2010 (gmt 0)

5+ Year Member

Thanks, I was going to post a similar question. I'm looking at a site that according to logs and webalizer serves 30k uniques and 200k page views per month. The site includes a not very active forum, which gets a few posts a week. G adsense, which is only displayed one ad/page on non forum pages, reports it's only displaying 30k impressions. So what do i take from that, that the G figure is a truer figure of site readership? Incredible difference. What's the best method to obtain 'true' stats. Is current site advertising itself as 200k page views inappropriate.
Any comments welcomed, thanks
2:03 pm on Feb 22, 2010 (gmt 0)

10+ Year Member

Just an hour ago I started to log the user-agents with the IP addresses.
Immediately search bots where coming in like 'msnbot/2.0b' and 'Yahoo! Slurp/3.0' and 'Googlebot/2.1', which while using the same user-agent, used a lot of different IP-addresses.
So i guess that answers my questions, and i logging ip's shows a bit too optimistic statistics.
1:36 am on Feb 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Your AdSense figures are probably closer to reality than the server logs. A server log will register "anything" - any time a page is served it shows there. Google AdSense is only going to be shown to an actual person using a web browser, so unless you get a ton of mobile visitors those numbers are closer to reality.
8:54 pm on Feb 23, 2010 (gmt 0)

5+ Year Member

I've read many website media packs containing traffic data, will these usually be based on server logs or the likes of GA? I'm intersted for comparison purposes as there is an enormous difference. Thanks
9:18 pm on Feb 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Media packs are usually based on "Visitors" or "Unique Visitors", which are both JavaScript based stats. Both come in a few flavours with some differences, so they're not always 100% comparable.

If media packs are server log based or based on IP-logging, they should write that, as those figures are often unreliable.

Featured Threads

Hot Threads This Week

Hot Threads This Month