Manually add URL to tweet


#1

How can I manually add a URL to the tweet button tweet? My URL’s are very large so I tiny URL them on the fly, and store them in a PHP variable. I wish to pass this to the JavaScript somehow instead of it getting the URL by itself.

Thanks!


#2

You can set an explicit URL for the Tweet button to share using the data-url parameter on the embed code. e.g.

Tweet

However, also note that Twitter automatically wraps all URLs now, so they will only take up 20 characters regardless of how long they are. They’ll be displayed truncated in the Twitter interface automatically so it’s not necessary to run them through a shortener unless you want to.

Ben


#3

Thanks a lot for your help Ben Ward that worked! :slight_smile:


#4