public function getUrlTrackEvent($category, $action, $name = false, $value = false)
    {
        $url = $this->getRequest($this->idSite);
        if (strlen($category) == 0) {
            throw new Exception("You must specify an Event Category name (Music, Videos, Games...).");
        }
        if (strlen($action) == 0) {
            throw new Exception("You must specify an Event action (click, view, add...).");
        }

        $url .= '&e_c=' . urlencode($category);
        $url .= '&e_a=' . urlencode($action);

        if (strlen($name) > 0) {
            $url .= '&e_n=' . urlencode($name);
        }
        if (strlen($value) > 0) {
            $value = $this->forceDotAsSeparatorForDecimalPoint($value);
            $url .= '&e_v=' . $value;
        }

        return $url;
    }
public function getUrlTrackEvent($category, $action, $name = false, $value = false)
    {
        $url = $this->getRequest($this->idSite);
        if (strlen($category) == 0) {
            throw new Exception("You must specify an Event Category name (Music, Videos, Games...).");
        }
        if (strlen($action) == 0) {
            throw new Exception("You must specify an Event action (click, view, add...).");
        }

        $url .= '&e_c=' . urlencode($category);
        $url .= '&e_a=' . urlencode($action);

        if (strlen($name) > 0) {
            $url .= '&e_n=' . urlencode($name);
        }
        if (strlen($value) > 0) {
            $value = $this->forceDotAsSeparatorForDecimalPoint($value);
            $url .= '&e_v=' . $value;
        }

        return $url;
    }
public function getUrlTrackEvent ( $ category , $ action , $ name = false , $ value = false ) { $ url = $ this -> getRequest ( $ this -> idSite ) ; if ( strlen ( $ category ) == 0 ) { throw new Exception ( "You must specify an Event Category name (Music, Videos, Games...)." ) ; } if ( strlen ( $ action ) == 0 ) { throw new Exception ( "You must specify an Event action (click, view, add...)." ) ; } $ url .= '&e_c=' . urlencode ( $ category ) ; $ url .= '&e_a=' . urlencode ( $ action ) ; if ( strlen ( $ name ) > 0 ) { $ url .= '&e_n=' . urlencode ( $ name ) ; } if ( strlen ( $ value ) > 0 ) { $ value = $ this -> forceDotAsSeparatorForDecimalPoint ( $ value ) ; $ url .= '&e_v=' . $ value ; } return $ url ; }
Builds URL to track a custom event.

@see doTrackEvent()
@param string $category The Event Category (Videos, Music, Games...)
@param string $action The Event's Action (Play, Pause, Duration, Add Playlist, Downloaded, Clicked...)
@param string|bool $name (optional) The Event's object Name (a particular Movie name, or Song name, or File name...)
@param float|bool $value (optional) The Event's value
@return string URL to piwik.php with all parameters set to track the pageview
@throws
Builds URL to track a custom event .