Solved

logging page views and excluding web bots

Posted on 2010-11-22
5
340 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:Lmillard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:effx
ID: 34187652
have you tried Google Analytics?
0
 

Author Comment

by:Lmillard
ID: 34187735
I do run analytics but this is for a component that sits in the ecommerce system itself
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 250 total points
ID: 34188055
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
 
LVL 10

Assisted Solution

by:effx
effx earned 250 total points
ID: 34188423
@SidFishes Why would you exclude every bot? would the list not be smaller if you included only Browsers?
0
 

Author Closing Comment

by:Lmillard
ID: 34191052
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video teaches users how to migrate an existing Wordpress website to a new domain.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question