Twitter Tweet Button does not count

后端 未结 7 1045
不思量自难忘°
不思量自难忘° 2021-02-05 07:45

I am using the official Tweet Button from Twitter to allow users to share my site.

The button itself is working just fine, however the counter doesn\'t work and stays at

相关标签:
7条回答
  • 2021-02-05 08:11

    I think you are missing data-via="#"

    <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.whattheplace.com/Show/1/" data-count="vertical" data-via="#">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    

    If its rapped around the add this im quite sure you should "mix" it with the twitter button itself, shouldn´t you be using something like:

    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style">
    <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
    <a class="addthis_button_tweet"></a>
    <a class="addthis_counter addthis_pill_style"></a>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=viralizate"></script>
    <!-- AddThis Button END -->
    

    I´m not finding the question clear enough, hope it helps anyway! if you explain further i will gladly edit it! - if i know the answer ;)

    Good luck!

    Trufa

    0 讨论(0)
  • 2021-02-05 08:13

    There are a few possible problems related to this. One of them is that if the link is shortened, Twitter won't add it up unless you add the "counturl" url property.

    Also, Twitter doesn't count the tweets coming from protected accounts (accounts that don't share their tweets).

    Please let me know if none of this offers the solution.

    Cheers!

    0 讨论(0)
  • 2021-02-05 08:17

    I had this problem too and found out that it was related to the value of the "canonical" link tag I had set. It was set to http:// www.iphone4simulator.com but tweet button was sharing http://iphone4simulator.com because I had set my DNS servers to remove www string from the address. As soon as I changed the canonical URL value in the markup to the latter, the button worked like a charm!

    0 讨论(0)
  • 2021-02-05 08:19

    you must use both "data-count" AND "data-url" if you want to show a count and there is a url shortener involved (and there always is):

      data-url="http://dev.twitter.com/pages/tweet_button"
      data-count="vertical"
    
    0 讨论(0)
  • 2021-02-05 08:24

    Something else to bear in mind is that the tweet counts are not accurate in real time. They are cached and updated asynchronously. See http://dev.twitter.com/pages/tweet_button_faq#count-api-increment

    0 讨论(0)
  • 2021-02-05 08:24

    it's not data-url, since that's the shortened url... you don't have to bother including that i don't think. set data-counturl=THE_PAGES_ACTUAL_URL so irregardless of what shortener someone uses, the count for your actual url gets incremented and displayed. so something like this... data-counturl="<?php echo $_SERVER['PHP_SELF']; ?>"

    --- ummm... nevermind, i spoke too soon...

    0 讨论(0)
提交回复
热议问题