The best part of this shorner is that it allows you to be able to customize the ending of your link with almost any symbol.The end variable - in your example, the “KqzGgBhM5” - is a reference number that is checked against a database. You can copy the resulting bit.ly link and use it in your tweets, in your e-mail, or even on your website. Setting the transport method to 'beacon' lets the hit be sent * using 'navigator.sendBeacon' in browser that support it. */ var trackOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, { 'transport': 'beacon', 'hitCallback': function(){document.location = url;} }); } You'll also need to add (or modify) the onclick attribute to your links.
It's one of the most widely used options out there, and you'll often find it integrated with lots of other services as well as third party apps like TweetDeck and TwitterFeed. Maybe you have the ad for your book in your sidebar, in your footer bar, and after your post content. When developing your application, however, feel free to use your preferred HTTP, JSON, and OAuth libraries. See if you are using Classic Analytics (ga.js) or Universal Analytics (analytics.js).