Example – jQuery URL Shortener use Google URL Shortener API

2

In jQuery URL Shortener Plugin Tutorial, I have covered how to use jQuery URL Shortener plugin.

You need to follow the below steps to use jQuery URL shortener Plugin.

1). Add jQuery script to your code. (Plugin requires jquery 1.6+)

2).Download https://github.com/hayageek/jQuery-URL-shortener and script to your code.

3). Get a Google API key. check this tutorial how to get Google API Key. During testing phase, you can make request without API key also.You can set the API key

4). Shortening a Long URL.

5). Convert Shortened URL to Long URL

6). Get Shortened URL Information.

You can get Shortened URL information like Clicks,Analytics by providing projection field to the API.

supported projection values are:
ANALYTICS_CLICKS – Get Clicks statics
ANALYTICS_TOP_STRINGS – Country,Browser specific statistics
FULL – Full statistics

Returned Sample Object, if the projection is  ANALYTICS_CLICKS

Returned Sample Object, if the projection is : ANALYTICS_TOP_STRINGS

 

Leave A Reply

Your email address will not be published.