[SOLVED] Tweet button count with vanity URL


#1

Hi all,

I have a client who have the Tweet Button embedded into their single blog posts pages.

They’d like to change this slightly to instead tweet and track the URL of the blog post once it’s been through their vanity URL (via bit.ly).

Getting the vanity URL into the tweet isn’t an issue using the data-url="" attribute and bit.ly API, however (I’m guessing) because this new vanity URL is a forwarding URL and not the actual URL to the page the Tweet Button isn’t tracking the count.

Is there anyway to overcome this issue without getting rid of the vanity URLs?

Thanks in advance.


#2

Quickly looking at the docs for the tweet button (https://dev.twitter.com/docs/tweet-button)

You could try this
data-url="short link"
data-counturl=“full link”

I haven’t tested it, but it might work.


#3

Problem solved by @walking_fishy:

Use the data-counturl="" for the real URL and data-url="" for the vanity URL

Just leaving this here in case it helps anyone else :smiley:


#4