Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How accurate are the hits counters?

Quote Reply
How accurate are the hits counters?
I was wondering as one of my listers (link owners) claims they get almost 5 times more hits from my website than what their listing hit counter shows?

I guess this is better than them compaining about the opposite, but still, if I'm sending people more traffic I want it to show on my pages. As I have paying customers and not all of them check their server stats I would like to show them that I am sending them a lot of traffic (if I am).

I am not talking about a build problem with my static pages not being up to date. I am talking about the actual hits registered in the database.

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Quote Reply
Re: [Anat] How accurate are the hits counters? In reply to
How many hits are we talking about? It could be that if a large number of hits are being made at the same time, SQL cannot cope with it, and therefore misses some of them. I'm not sure how GT would get around this, but I know its the case on a few adult sites I have worked with...

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How accurate are the hits counters? In reply to
My counter shows 25 for one month. Her counter shows about 30 for one week.

Assuming not everyone rushed to her site in the same second :D I don't think these numbers should be a problem right?

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Quote Reply
Re: [Anat] How accurate are the hits counters? In reply to
I think the answer is probably in this part of Links/User/Jump.pm:

# Jump to a URL, bump the hit counter.
else {
$goto = $rec->{URL};

my $ip = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR} || 'None';
my $click_db = $DB->table ('ClickTrack');
my $rows = $click_db->count ( { LinkID => $id, IP => $ip, ClickType => 'Hits' } );
if (! $rows) {
$db->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
$click_db->insert ( { LinkID => $id, IP => $ip, ClickType => 'Hits', Created => \"NOW()"} );
}
}
}

I think that if the IP address of the person clicking on the link is already found in the ClickTrack table, then it won't increment the hit counter. So if the same person clicked on the link 5 times on the same day, it would still only increment the hit counter once. This is probably to guard against someone repeatedly clicking on the same link to up the hit counter. Unfortunately, I'm not very good at PERL, so maybe someone else who knows better could explain how to modify the code so that this restriction is lifted.

-Frank
Quote Reply
Re: [FrankM] How accurate are the hits counters? In reply to
Thanks for the explanation Frank. Is it a daily limit? I mean if the same person clicks again a few days later is that also ignored?

I would also be interested in lifting the restriction if any of you perl gurus here can help with that...

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Quote Reply
Re: [Anat] How accurate are the hits counters? In reply to
Should be pretty simple....remove the sutff I have in RED;

Code:
# Jump to a URL, bump the hit counter.
else {
$goto = $rec->{URL};

my $ip = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR} || 'None';
my $click_db = $DB->table ('ClickTrack');
my $rows = $click_db->count ( { LinkID => $id, IP => $ip, ClickType => 'Hits' } );
if (! $rows) {

$db->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
$click_db->insert ( { LinkID => $id, IP => $ip, ClickType => 'Hits', Created => \"NOW()"} );
}
}
}

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Nov 8, 2002, 8:15 AM
Quote Reply
Re: [Andy] How accurate are the hits counters? In reply to
...which will give an error because $click_db and $ip are not defined Tongue

Last edited by:

Paul: Nov 8, 2002, 8:10 AM
Quote Reply
Re: [Paul] How accurate are the hits counters? In reply to
Whoops Blush I've edited the above post....

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Anat] How accurate are the hits counters? In reply to
Here's a shameless plug:

My ExtraStats plugin collects all the hit data and allows you to display it daily and monthly. You still get the hit data that LinksSQL collects but it also collect all the extra hits that LinksSQL ignores.

Read more about it here:

http://www.gossamer-threads.com/...i?post=221261#221261

Laura.
The UK High Street
Quote Reply
Re: [afinlr] How accurate are the hits counters? In reply to
LOL...should have seen that one coming..heheh

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Anat] How accurate are the hits counters? In reply to
Hi-

With regard to the question about a daily limit, the ClickTrack table keeps information on hits for specific links. Each time you run the Build All, there's code in the Links/Build.pm that removes data from ClickTrack that is older than two days. This code from Build.pm is below.

sub build_reset_hits {
# ------------------------------------------------------------------
# Remove old hit and rate tracking information.
#
Links::init_date();
my $delete_by = GT::Date::date_get ( time() - 172800 ); # 2 days old
my $click_db = $DB->table ('ClickTrack');
$click_db->delete ( GT::SQL::Condition->new ( 'Created', '<', $delete_by ));
}
END_OF_SUB

If you run the build everyday, it will keep removing things that are older than two days. If you don't build regularly, it will keep accumulating the hits information, though.

If you don't modify the Jump.pm as Andy provided code for to remove the IP restriction, then if you ran the nph-build.cgi everyday, it wouldn't record hits for any repeats made within two days.

So, finally, I think you can do the modification that Andy provided, and then it should record all hits (even if someone just sits there and keeps going back and clicking on the same link over and over). Or, if you wanted to have the restriction for no repeat hits from the same person (IP Address) for one day, I think you could replace 172800 above with 86400. Then it will remove data on hits for the past 24 hours. Just remember that you would need to make sure to run the Build All everyday.

-Frank
Quote Reply
Re: [FrankM] How accurate are the hits counters? In reply to
Thanks everyone!

I have made the suggested change and it seems to be working fine :)

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Quote Reply
Re: [Andy] How accurate are the hits counters? In reply to
Hi Andy,

What if all I wanted to do was to "not limit" the IP or clicks by a specific IP?

For example, if a large corporation sends you a lot of hits and they are coming from behind a firewall it may show one IP address for all of their users. So making it not sensitive to the IP address would be good in a lot of cases.

Does the same apply to the review and rate areas?

Thanks in advance