Counts clicks twice

Post your Click counter digestion problems here
Post Reply
Zavarzin
Posts: 5
Joined: Sat Jan 31, 2015 12:26 am

Counts clicks twice

Post by Zavarzin »

I added links to CCount and then shortened with Bit.ly but when I look at statistics CCount shows visits twice.

Is there any solution to this?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Counts clicks twice

Post by Klemen »

Does the same thing happen in you use original CCount generated links?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Zavarzin
Posts: 5
Joined: Sat Jan 31, 2015 12:26 am

Re: Counts clicks twice

Post by Zavarzin »

No, this only happens when I shorten with Bitly.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Counts clicks twice

Post by Klemen »

It appears Bitly sends a bot to the link used for something like determining popular links.

You can try opening click.php and just below

Code: Select all

define('IN_SCRIPT',1);
add

Code: Select all

if ( isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'TweetmemeBot') !== false)
{
	die('');
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Zavarzin
Posts: 5
Joined: Sat Jan 31, 2015 12:26 am

Re: Counts clicks twice

Post by Zavarzin »

Thanks. But if I insert this code, will my Twitter statistics still show clicks and country or they won't work?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Counts clicks twice

Post by Klemen »

It will block a bot used by Bitly, not your Twitter account.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Zavarzin
Posts: 5
Joined: Sat Jan 31, 2015 12:26 am

Re: Counts clicks twice

Post by Zavarzin »

I've added the code, but unfortunately it doesn't solve the problem.

CCount shows 10s times more clicks than Twitter.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Counts clicks twice

Post by Klemen »

In that case I can't be of help - CCount works fine (as proved if you use CCount generated links), but Twitter (or Bitly) probably verifies links and CCount counts visits from their bots.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply