AddThis Academy

An ever-growing library of resources to help you become a better online marketer.

URL Shortening

Our share-time URL shortening makes it easy to integrate AddThis with your bit.ly click analytics. Twitter shares are automatically shortened with t.co so you only need to use this feature if you want bit.ly integration. Best of all, it works with vanity domains as well as the usual bit.ly domains.

At this time, only shares to Twitter are supported with our bit.ly shortening service.


Optional: To configure our URL shortener to use your bit.ly account, you need to provide us with your bit.ly login and API Key which you can retrieve from https://bitly.com/a/settings/advanced. Once you have that, sign in to AddThis, go to the profile settings page and select the profile you’d like to link to your bitly account. In your profile settings you’ll find a form that lets you enter your bitly login and API key. Your key will be stored safe on our servers and won’t be exposed in your site’s html. Lastly you’ll need to update your sharing config.

Make sure your AddThis profile ID (pubid) is correctly configured, else we won’t be able to look up your key.

Bit.ly Shortening with Sharing Buttons

If you’re using our sharing buttons, add the code below to your addthis_share configuration object and specify the services that you want to use shortening.  For example “twitter”, as shown here:

<script type="text/javascript">
var addthis_share = {
     // ... other options
     url_transforms : {
          shorten: {
               twitter: 'bitly'
          }
     }, 
     shorteners : {
          bitly : {} 
     }
}
</script>

You’ll also need to make sure that your page has a valid canonical tag in order for the URL shortening to work properly.

Bit.ly Shortening with Sharing Endpoints

If you’re using our sharing endpoints, add “shortener=bitly” on your requests. As an example, your URL might look like this:

http://api.addthis.com/oexchange/0.8/forward/twitter/offer?url=http://www.csmotorclub.com/2011/10/2011-chumpcar-2525-25-at-nelson-ledges/&pubid=numbakrrunch&shortener=bitly

URL Shortening
3.7 (73.33%) 3 votes

Was this article helpful to you?

Last modified:  October 24th, 2018