Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a twitter button using the code and instructions here: https://twitter.com/about/resources/buttons

Here is my code

<a href="https://twitter.com/share" class="twitter-share-button" data-text="The Burger Kings in Toronto at 33497 Yonge St rated 4/5 with 1 review" data-url="http://mydomain.com/d/902463" data-via="mytwitteraccount" data-lang="en" data-count="vertical">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="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

But the count is not updated when someone uses the button, why is that?

The page url is not exactly the data-url value I have specified it's only a short url that will redirect to the actual url which is longer.

What's the trick here? Should I use the full url or is there something else I'm missing?

share|improve this question
up vote 4 down vote accepted

From the button FAQ:

I use a URL shortener and my count isn’t incrementing, what’s wrong?

When asking how many times a link has been Tweeted the Tweet Button uses the URL you ask it to share. If this is a shortened URL this will often return 0. This is because Tweet Button counts the final destination of the URL passed to it, not the shortened one.

If you are experiencing this problem you should use the counturl property and set it equal to the final destination of your short URL. For an example see the Tweet Button documentation.

share|improve this answer
This is what I'm using now, both data-url and data-urlcount are the same, still no count <a href="twitter.com/share"; class="twitter-share-button" data-text="Race Car Repairs in Whitehorse at 2121 Second Ave rated " data-url="mydomain.com/biz/race-car-repairs/yt/whitehorse/address/"; data-counturl="mydomain.com/biz/race-car-repairs/yt/whitehorse/address/"; data-via="mydomain" data-lang="en" data-count="vertical">Tweet</a> – user893730 Feb 15 '12 at 20:58
It seems like this may not be an instant thing like fb likes, seems like twitter needs to show the tweet in search results in order for the count to work, will know by tomorrow. – user893730 Feb 15 '12 at 22:25
I confirm, it's a twitter delay issue – user893730 Feb 15 '12 at 22:36

If anyone comes across this problem lately it is because Twitter announced that they are deprecating the count feature for tweet buttons on November 20, 2015. More information from Twitter can be found here also.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.