Shorten URLs in Google Documents

Panini has written an add-on for Google Documents that will automatically shorten all the hyperlinks (URLs) in the existing document using the bit.ly API. You’ll need to supply your own Bitly API key to be able to track clicks inside your Bitly dashboard.

A similar approach may be used to shorten links with goo.gl though you would need to enable the Google URL shorterner service from the services console.

Here’s another snippet by Dave Johnson that shortens URLs in Google Docs using the goo.gl service. It works for even ftp URLs and the good thing is that it ignores URLs that are already shortened.