The Wayback Machine - https://web.archive.org/web/20150928205035/https://dev.twitter.com/web/tweet-button/faq

Tweet Button FAQ

If you have another question which isn’t answered let us know on the Developer Forums.

Which browsers does the Tweet Button support?

The Tweet Button has been tested for support with the most popular browsers. Browsers which do not support the required JavaScript features will still function but will only see a default hyperlink. Browsers actively tested for compatibility:

  • Internet Explorer 9+
  • Chrome 37+
  • Safari 7+
  • Firefox 36+
  • Android Browser 4.4+

Does the Tweet Button support other languages?

The Tweet Button is available in 28 languages. The language code may be formatted as ISO 639-1 alpha-2 (en), ISO 639-3 alpha-3 (msa), or ISO 639-1 alpha-2 combined with an ISO 3166-1 alpha-2 localization (zh-tw).

For example:

  • Set a lang attribute on your page’s html element to help Twitter match widget content to your site’s language.
  • For English use lang="en"
  • For Japanese use lang="ja"
  • For Spanish use lang="es"

What are the dimensions of the Tweet Button?

Tweet Button without count

The Tweet Button is 55 pixels wide and 20 pixels high.

Tweet Button with horizontal count

A Tweet Button with horizontal count is 110 pixels wide and 20 pixels high. The 110 pixel width is made up from 55 pixels for the button, 3 pixels for the space separating the count from the button and 52 pixels for the count itself.

Tweet Button with vertical count

With a vertical count the combined dimensions are 55 pixels wide by 62 pixels high. The 62 pixel height is made up from 20 pixels for the button, 2 pixels for the space separating the count from the button and 40 pixels for the count itself.

Internationalized Tweet Buttons

Internationalized Tweet Buttons have slightly different dimensions.

Language`lang` codeNo CountHorizontal CountVertical Count
Englishen55px by 20px
110px by 20px
55px by 62px
Japaneseja80px by 20px
130px by 20px
80px by 62px
Spanishes64px by 20px
110px by 20px
64px by 62px

What happens if twitter.com has an error or is over capacity?

The Tweet Button is hosted on a high performance content distribution network and is kept separate from twitter.com. This means if twitter.com goes down your site will not be affected and the button will still display. What will happen is when a user presses the Tweet Button the Share Box will fail to load and users will instead see a Twitter error page. Also, in some cases, the count may not be displayed.

I want to use multiple Tweet Buttons on my page. Is there anything I should know?

If you want to use more than one Tweet Button on a page you there are a couple of things you will want to check.

  1. If you are using the JavaScript Tweet Button, make sure you only include the widgets.js javascript once. The best place to put the JavaScript is before the closing </body>
  2. To avoid duplication of content on your page consider using the rel="me" and rel="canonical" tags in place of the via and url data points on each Tweet Button.

Only two accounts are displayed and by default the via user is shown first with the first related account shown afterwards. If the user is a follower of the via user the Share Box will instead show the first two related accounts the user isn’t a follower of. No accounts are displayed if the user follows all of the suggested accounts (via and related).

Learn more about related accounts.

My count doesn’t seem to be going up, is something wrong?

To improve performance we cache the count before displaying it. The cache is updated frequently but on some occasions it may look like your count is not increasing while the cache is updated. In addition, the count only includes public Tweets meaning a Tweet from a protected account will not cause an increase.

Additionally, there is currently a requirement that your server support HTTP HEAD requests in order to update the count properly. An easy way to check this is to use the command-line curl program, passing the -I (capital i) flag. A successful request should have a HTTP 200 OK response:

$ curl -I https://dev.twitter.com
HTTP/1.1 200 OK
Date: Thu, 22 Sep 2011 23:16:39 GMT
Server: Apache
Cache-Control: no-cache, no-store, must-revalidate, post-check=0, pre-check=0
Expires: Sun, 11 Mar 1984 12:00:00 GMT
Pragma: no-cache
Last-Modified: Thu, 22 Sep 2011 23:16:20 +0000
Vary: Cookie,Accept-Encoding
Connection: close
Content-Type: text/html; charset=utf-8
...

An unsuccessful request may return a HTTP 4xx or 5xx error:

$ curl -I http://baddomain.example.com
HTTP/1.1 405 Method Not Allowed
...

When did Twitter start counting the links?

We started counting a couple of weeks before the launch of the Tweet Button. This means links shared on Twitter before July 2010 are not contributed towards the count. However, all publicly Tweeted links since then have been counted and the Tweet Button will reflect that.

Does the Tweet Button work over HTTPS?

Yes, the Tweet Button works over HTTPS.