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!