Solved

logging page views and excluding web bots

Posted on 2010-11-22
5
336 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
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
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.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now