protected function getShortenedUrl($url, $uniqueId = null)
    {
        // skip if localhost
        if (in_array(parse_url($url, PHP_URL_HOST), array('localhost', '127.0.0.1'))) {
            return $url;
        }

        $link = new Link();
        $link->setLongUrl($url);

        $this->urlShortener->shorten($link);

        return $link->getShortUrl();
    }