1. Home
  2. Google URL Shortener
  3. How to use

How to use

You can shorten any URL by placing the following code in the appropriate controller file. It can be used in both admin as well as catalog (store front)

1
$this->url->shorten('Your Long URL here', $this->config->get('google_urlshortener_api'), $this->config->get('google_urlshortener_logs'));

Example

$this->url->shorten('https://www.huntbee.com/resources/', $this->config->get('google_urlshortener_api'), $this->config->get('google_urlshortener_logs'));

 

Note: If API key is incorrect or not properly setup, then the above code will return the input URL.

Was this article helpful to you? Yes No

How can we help?