added code and test suite for a series of functions that

identify non-human web clients so that advertising can
eliminate ghost impressions and ghost clicks
This commit is contained in:
David Delikat 2009-02-23 00:20:46 +00:00
parent fdeece9a64
commit af5ad84fc8
5 changed files with 305 additions and 2 deletions

View file

@ -52,6 +52,7 @@ sub countClick {
my $session = shift;
my $id = shift;
my ($url) = $session->db->quickArray("select url from advertisement where adId=?",[$id]);
return $url if $self->session->env->requestNotViewed();
$session->db->write("update advertisement set clicks=clicks+1 where adId=?",[$id]);
return $url;
}
@ -131,6 +132,7 @@ A boolean that tells the ad system not to count this impression if true.
sub displayImpression {
my $self = shift;
my $dontCount = shift;
return '' if $self->session->env->requestNotViewed();
my ($id, $ad, $priority, $clicks, $clicksBought, $impressions, $impressionsBought) = $self->session->db->quickArray("select adId, renderedAd, priority, clicks, clicksBought, impressions, impressionsBought from advertisement where adSpaceId=? and isActive=1 order by nextInPriority asc limit 1",[$self->getId]);
unless ($dontCount) {
my $isActive = 1;