logging page views and excluding web bots

Hi,

I want to be able to do a count of how many times individual product pages are viewed on my webshop but need to log only visits made by actual users and exclude all web bots and search engine scans.
Does anyone know of a way to determine if the page view is an actual user?

Cheers
Leigh
LmillardAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
SidFishesConnect With a Mentor Commented:
You can search for bots in the user agent string. I've shown just 3 in the example. There are over 300 listed at http://www.robotstxt.org/db.html so you'd have to add them to the regex string. This won't get -all- but it should be most.

caveat - not sure the impact of regex-ing a 300 word list on every page load so you'd want to watch performance.

<cfscript>
if (ReFindNoCase("Slurp|Googlebot|msnbot", CGI.http_user_agent )){
log= false;
} else {
log = true;
}
</cfscript>
 
<cfif log eq true>
your logging code
</cfif>

0
 
effxCommented:
have you tried Google Analytics?
0
 
LmillardAuthor Commented:
I do run analytics but this is for a component that sits in the ecommerce system itself
0
 
effxConnect With a Mentor Commented:
@SidFishes Why would you exclude every bot? would the list not be smaller if you included only Browsers?
0
 
LmillardAuthor Commented:
I think between SidFishes logic and effx's suggestion of looking for the browser rather than the bots this should be perfect. Thanks both
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.