Tweet Button Shows 0 Fix

Twitter has a fancy widget/button called the Tweet Button that allows your readers to click a button to tweet about your webpage. It includes a count of how many people have tweeted about your page, similar to Facebook’s “like” button.

If your tweet button count seems to be stuck at zero try adding the data-counturl field. Its value should be the URL of the page you want the button to count (most likely the same value as your data-url field). Your tweet button code should look something like this:

<script src="http://platform.twitter.com/widgets.js" type="text/javascript"> </script>
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="http://friendorfollow.com"
data-via="FriendOrFollow"
data-counturl="http://friendorfollow.com"
data-text="Who are you following that's not following you back? Find out here:"
data-related="DustyReagan:Creator of Friend or Follow,Cesart:Designer of Friend or Follow"
data-count="horizontal">Tweet</a>

This example above is obviously for FriendOrFollow.com. Just swap out the details with your own site or page.

This entry was posted in Web & Software Development and tagged . Bookmark the permalink.

One Response to Tweet Button Shows 0 Fix

  1. tonia says:

    thank you for the post , i have a tweet button on my page and i am trying to test it ,and the problem i am facing is that after i tweet the count changes to 1 which is correct , but if i refresh the page the count number goes back to 0.
    Please can u help or advise??

Leave a Reply

Your email address will not be published. Required fields are marked *