Tracking visits with the Karma plugin

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
alemartini
Regular
Posts: 16
Joined: Sat Oct 11, 2008 10:43 pm

Tracking visits with the Karma plugin

Post by alemartini »

I'm working on a new blog, and I've installed the Karma plugin in order to track the views per post and show the total number of views below each article. I'm not interested in Karma as a voting plugin, and in fact I've disabled most of its features.

Yesterday I decided to post my first article, and this morning I had a 300 count for that post. That seemed quite odd to me, specially considering that no one knows about the blog yet.

When I looked into the Apache log files, I could see that all of the visits came from Googlebot (except for a few ones, coming from my own IP address).

So the question is: is this the expected behaviour or am I missing some special configuration in order to make Karma not to count bot hits?

I've browsed trhough serendipity_event_karma.php, and I see around line 560 an if block that seems to filter votes coming from Google:

Code: Select all

// We don't want googlebots hitting the karma-voting
                    if (stristr($_SERVER['HTTP_USER_AGENT'], 'google')) {
                        $this->karmaVote = 'invalid1';
                        return ;
                    }
However, I'm not sure if that is enough to stop Karma from counting Google visits.

Is it possible that visits are being counted unconditionally (that is, only taking into account if visit tracking is enabled and if logged in users should be counted or not)?

Thanks for any help you can provide.

--
Alex
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Tracking visits with the Karma plugin

Post by garvinhicking »

Hi!

That's true, the plugin currently tracks all page views as a hit, also from search engines. It's quite hard to keep up to date with all bots.

The code you pasted only applies to the karma Voting, not the hit tracking.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply