Page 1 of 1

Tracking visits with the Karma plugin

Posted: Sun Dec 14, 2008 11:53 pm
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

Re: Tracking visits with the Karma plugin

Posted: Mon Dec 15, 2008 11:45 am
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