forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: E. William on December 29, 2013, 11:19:03 am
-
Hi,
I've used this modification (http://forum.coppermine-gallery.net/index.php/topic,74263.0.html) (counting hits on refresh) and noticed that hits from web crawlers are also counted (not sure if that also occurs without this mod). Is there a way not to count bot hits, but only human hits while using this mod?
Again, thanks so much for your help.
-
How do you want to distinguish if a visitor is a bot or a human? You'd need to rely on the browser's user agent or filter by IP.
-
How do you want to distinguish if a visitor is a bot or a human? You'd need to rely on the browser's user agent or filter by IP.
The detailed hit stats do recognize Googlebots (not sure about others, since my website hasn't gone officially live yet). So theoretically it should be able to identify at least certain webcrawlers. Not sure if it's worth the effort (depending on how often the pages are crawled). I could tell the bots to only crawl certain pages once a year...
I've also noticed that pages are crawled multiple times through album keywords, resulting in different links to the same pages (all meta pages have a nofollow tag). I might also look into using canonical tags.
-
You could use cpg_determine_client(), which returns an array like
$return_array = array(
'os' => $os,
'browser' => $browser,
'query_terms' => $query_terms
);
You'd need to check the browser part and exclude the "browsers" you don't want to add hits.
-
Have a look at the function cpg_determine_client() in include/functions.inc.php to get an idea what browsers Coppermine detects.