Craft\InstantAnalyticsService::eventTrackingUrl PHP Method

eventTrackingUrl() public method

Get an Event tracking URL
public eventTrackingUrl ( string $url, string $eventCategory = "", string $eventAction = "", string $eventLabel = "", string $eventValue ) : string
$url string the URL to track
$eventCategory string the event category
$eventAction string the event action
$eventLabel string the event label
$eventValue string the event value
return string the tracking URL
    public function eventTrackingUrl($url, $eventCategory = "", $eventAction = "", $eventLabel = "", $eventValue = 0)
    {
        $urlParams = array('url' => $url, 'eventCategory' => $eventCategory, 'eventAction' => $eventAction, 'eventLabel' => $eventLabel, 'eventValue' => $eventValue);
        $fileName = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_BASENAME);
        $trackingUrl = UrlHelper::getSiteUrl('instantanalytics/eventTrack/' . $fileName, $urlParams);
        InstantAnalyticsPlugin::log("Created eventTrackingUrl for " . $trackingUrl, LogLevel::Info, false);
        return $trackingUrl;
    }