You'll just need to add the bit which updates the hits into the section which does the downloads.
Copy
my $ip1 = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR} || 'None';
my $click_db1 = $DB->table ('ClickTrack');
my $rows1 = $click_db1->count ( { LinkID => $id, IP => $ip1, ClickType => 'Hits' } );
if (! $rows1) {
$db->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
$click_db1->insert ( { LinkID => $id, IP => $ip1, ClickType => 'Hits', Created => \"NOW()"} );
}
Into the previous section. I think the best place is probably just before the line
return 1;
Copy
my $ip1 = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR} || 'None';
my $click_db1 = $DB->table ('ClickTrack');
my $rows1 = $click_db1->count ( { LinkID => $id, IP => $ip1, ClickType => 'Hits' } );
if (! $rows1) {
$db->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
$click_db1->insert ( { LinkID => $id, IP => $ip1, ClickType => 'Hits', Created => \"NOW()"} );
}
Into the previous section. I think the best place is probably just before the line
return 1;