Hello, I have the following situation:
URL http://www.example.com/news/123/hello-world HEAD: <link rel='canonical' href='http://www.example.com/news/123' /> <meta property='og:url' content='http://www.example.com/news/123' /> BUTTON: <iframe src="https://platform.twitter.com/widgets/tweet_button.html?url=http://www.example.com/news/123/hello-world&counturl=http://www.example.com/news/123"></iframe>
The problem is that the counts across the two URLs
are not being consolidated. The first ends up having 100 tweets and the other 50 tweets but ideally they should be consolidated as 150 tweets.
Also of note is that the URL
/news/123does not redirect to
news/123/hello-world, however, the URL
/news/123as the canonical URL in the
<head>. This works fine for FB and G+ but not Twitter which doesn’t seem to inspect the canonical URL header tag. I would prefer a solution that works without a 301 redirect if possible as that has coding and perf implications. I imagined that
counturlwould fix this but it doesn’t (maybe because some users are Tweeting the URL directly via an app instead of the website button)
The second issue I am facing is that the slug can change, so the URL:
/news/123/hello-worldcan change to
but I would like to retain the tweet count. For this reason, I list the canonical URL as
/news/123which is unchanging (again, this works well with FB and G+). However, I am afraid that given my current issue, Twitter will end up splitting tweet counts across three URLs:
Related to #1, how does Twitter count work? When someone shares a Tweet directly on Twitter (via app or plugin), does Twitter crawl the URL and read the META headers to determine the canonical URL and then consolidate the tweets to that canonical URL?
Again, related to #1, the
counturlproperty is not a meta tag but rather an API parameter, so I am guessing for direct Tweets (done via app or plugins), Twitter doesn’t know about the
counturlassociated with the URL. How then does this work then? Does Twitter require someone Tweet at least once using the button on the website and then caches the
counturlagainst the actual
urlfor all subsequent Tweets direct or indirect?
Thanks very much for your help. I found the dev documentation is sparse on these details. A self-help Twitter debugger tool like the FB debugger would make things very easy for developers like myself.