This can be done online, at the web pages of a URL shortening service; to do it in batch or on demand may require the use of an API. Then you should get rid of the sidebar ad and focus on the other two placements.
Whenever you paste a link into Buffer to be scheduled to post at a later time, it automatically shortens the link for you. White labeling lets me present a positive picture of our company as clients see our agency logo when they login to create URLs. Don’t worry so much about the whole base64 thing though.
See if you are using Classic Analytics (ga.js) or Universal Analytics (analytics.js).