Tweet button count not working properly with data-counturl that contains hashbang


I have multiple Tweet buttons in the site each one inside a “page” with a different hashbang ( “#!foo/bar”, “#!lorem/ipsum” ) and I’m using the “data-counturl” like: data-counturl="!foo/bar" (same value as I’m using for “data-url” as well)

I would expect the tweet button to treat them as different pages altogether (since they are indeed different pages on my site) and/or do a request for “?escaped_fragment=foo/bar” and “?escaped_fragment=lorem/ipsum” to detect the redirects instead of simply displaying the tweet count of the index page for all of them.

PS: My application really needs the hashbang since it should work the same way in browsers that doesn’t support the HTML5 history API (update content dynamically and have deep links).


I’m facing the same issue. is there any solution/work-around available?


Though this thread was started 2 years ago this issue still exists. If counturl points to hashbang URL it seems that Twitter considers only base URL ignoring hash fragment.

E.g., if I share these links:!sub-path-1!sub-path-2!sub-path-3

All three shares will be counted for just that is wrong.

Is there any workaround/solution for this?


All parts of the URL after the # are not accessible to servers, so we are only able to count URLs up to, everything after that only exists on the client-side. This is just how URLs work.

You should avoid using document fragments for discrete content paths, and instead use the browser pushState API to allow client-side navigation using full URLs.