Smile\ElasticsuiteTracker\Helper\Data::getBaseUrl PHP Method

getBaseUrl() public method

Return the tracking base URL (params are added later)
public getBaseUrl ( ) : string
return string
    public function getBaseUrl()
    {
        $result = $this->scopeConfig->getValue(self::CONFIG_BASE_URL_XPATH);
        if (!$result) {
            $params = ['_secure' => $this->_getRequest()->isSecure()];
            return $this->assetRepository->getUrlWithParams("Smile_ElasticsuiteTracker::hit.png", $params);
        }
        return $result;
    }

Usage Example

Example #1
0
 /**
  * Retrieve beacon Url
  *
  * @return string
  */
 public function getBeaconUrl()
 {
     return $this->trackerHelper->getBaseUrl();
 }