shortenURL

Shortens the provided url

shortenURL(apiKey: String, link: String, cb: Function)
Parameters
apiKey (String) api key of your google application
link (String) that you want to shorten
cb (Function) with following signature function (err, shortenedLink)

expandURL

Expands the provided shortened url

Supported projections

  • ANALYTICS_CLICKS: Returns only click counts
  • ANALYTICS_TOP_STRINGS: Returns only top string counts
  • FULL: Returns the creation timestamp and all available analytics
expandURL(apiKey: String, shortened: String, projection: String, cb: Function, shortLink: any)
Parameters
apiKey (String) api key of your google application
shortened (String) link that you want to expand
projection (String) to include more info ANALYTICS_CLICKS| ANALYTICS_TOP_STRINGS | FULL
cb (Function) with following signature function (err, expanedLink)
shortLink (any)

getAnalyticsURL

Returns the url for the google analytics page for the given shortened url.

Example

getAnalyticsURL('https://goo.gl/un5E')

=> https://goo.gl/#analytics/goo.gl/un5E/all_time

getAnalyticsURL(url: String): String
Parameters
url (String) shortened URL, i.e. obtained via shortenURL
Returns
String: link to the Google Analytics page.