Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Best Method for Tracking Visits/Impressions
January 13, 2006, 4:55 pm
rate this thread
I'm having a few issues with keeping track of visitors and page
impressions on my website. No matter how much I search, I can't find
the answer to my question.
Essentially I have two PHP counter scripts, one for visitors and one
for impressions. These interact with our Mysql database. So no problems
there. My question is how the visitor and impressions counter should
work, to give the most accurate results.
Previously I simply had my counter page included in every page with an
'include' statement. It only did this if the User Agent (obtained using
PHP) was not the Googlebot, MSN bot or Yahoo spider bot. The counter
script then checked for a cookie, and worked out whether they were a
unique visitor or an impression. This produced results, figures of
around 50,000 visitors per day and 80,000 impressions per day. However,
I read that the best way to do a counter is to include in in an <img>
tag at the bottom of the page. So I did this. The figures have dropped
by more than half since I did this.
I set up an extra db table to track and store all the people visiting
the site, their ip, their user agent etc. I then added into the counter
a query that set counted='y' in the database if it counted them as a
unique visitor. That is when I started to notice that some of the
people who were actually visitors to the site (came from a search
engine search) were not being counted. I guess that those people may
have the images switched off in their browsers, or may be using text
So my question really is, have I chosen the right way to count visitors
and impressions, or should I choose another way? What methods to other
Re: Best Method for Tracking Visits/Impressions
Before that question can be answered, there are two more that need to
1. What is the purpose of the site?
2. What are you using the figures for?
http://www.MotorwayServices.info - read and share comments and opinons
"Too sweet to be sour too nice to be mean"