Hi.
I've read through a lot of forum posts and all your documentation on this, but I fail to get url shortening to work. What I use:
* Twitter button ("addthis_button_twitter", NOT the native tweet button)
* A dynamic url (multiple articles on the page) using "addthis:url"
* A twitter template to format the tweet - url embedded using {{url}}
* My own bit.ly account
Url shortening does not work. The sample urls I'm trying are >60 characters, so it's not the issue with the 40 characters limit. I've tried various setups, removed my custom bit.ly account to use the built-in shortening (also not working), passed in the urls using inheritance and directly etc. etc. - it's simply not working, the full url always is sent to Twitter. Code:
<script type="text/javascript">
var addthis_config = {
pubid: "xxxxxxxxxx",
data_track_clickback: false,
url_transforms : {
shorten: {
default: 'bitly'
}
},
shorteners : {
bitly : {
login: 'xxxxxxxxxx',
apiKey: 'xxxxxxxxxx'
}
}
}
var addthis_share = {
templates: { twitter: '{{title}} - {{url}} by @xxxxxxxxxx' }
}
</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
... somewhere else on the page ...
<div class="addthis_toolbox addthis_default_style">
<a class="addthis_button_twitter" addthis:url="<%=[some code that generates the url] %>" addthis:title="<%=[some code for the title] %>"></a>
<!-- ... -->
What is wrong here? Thank you for your help.
Nevermind. The problem was: I was testing all this on my development machine, and hence all the links were either "http://localhost/..." or "http://machinename/...". Apparently the parsing and shortening is not working for that kind of urls. When I uploaded the code to a public domain it worked.
Maybe you can add that as a hint for other to your documentation.
This question is closed to new answers.