Faking the Twitter button count

9th October 2013
Recently someone was struggling to get the count button to work on their twitter button.

They were using a shortening service other to twitters own (bit.ly). So when the tweet button was clicked the counter wasn't showing the number of shares.

The solution was to use data-counturl="full url" as well as the data-url="shortened url"
See the docs for more details (https://dev.twitter.com/docs/tweet-button)

This posed an interesting question, if you set data-counturl to something like Google, what would happen?

Here is the code I used to generate two twitter buttons (one with no data-counturl and one with it set to google)

<a href="https://twitter.com/share" class="twitter-share-button" data-lang="en">Tweet</a>    
<a href="https://twitter.com/share" class="twitter-share-button" data-lang="en" data-counturl="http://www.google.com/">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Here is the result


Turn outs that the button showed a count of over 100k, so I guess they cant be trusted.


No! Don't trust them.