PHP Class Piwik\Tracker\Request

Afficher le fichier Open project: piwik/piwik Class Usage Examples

Protected Properties

Свойство Type Description
$isAuthenticated
$params array
$rawParams
$tokenAuth

Méthodes publiques

Méthode Description
__construct ( $params, boolean | string $tokenAuth = false )
authenticateSuperUserOrAdmin ( $tokenAuth, $idSite )
getBrowserLanguage ( ) : string Returns the language the visitor is viewing.
getCurrentTimestamp ( )
getCustomVariables ( $scope )
getCustomVariablesInPageScope ( )
getCustomVariablesInVisitScope ( )
getDaysSinceFirstVisit ( ) : float | integer
getDaysSinceLastOrder ( ) : boolean | float | integer
getDaysSinceLastVisit ( ) : float | integer
getForcedUserId ( )
getForcedVisitorId ( )
getGoalRevenue ( $defaultGoalRevenue )
getIdSite ( )
getIp ( )
getIpString ( ) : mixed | string
getLocalTime ( ) : string
getMetadata ( string $pluginName, string $key ) : mixed Get a request metadata value. Returns null if none exists.
getPageGenerationTime ( ) 1 hour
getParam ( $name )
getParams ( )
getPlugins ( )
getRawParams ( ) : array Get the params that were originally passed to the instance. These params do not contain any params that were added within this object.
getTokenAuth ( )
getUserAgent ( )
getUserIdHashed ( $userId ) : string Matches implementation of PiwikTracker::getUserIdHashed
getVisitCount ( ) : integer | mixed
getVisitorId ( ) Returns the ID from the request in this order: return from a given User ID, or from a Tracking API forced Visitor ID, or from a Visitor ID from 3rd party (optional) cookies, or from a given Visitor Id from 1st party?
isAuthenticated ( ) : boolean
isEmptyRequest ( )
setCurrentTimestamp ( $timestamp )
setMetadata ( string $pluginName, string $key, mixed $value ) Set a request metadata value.
setParam ( $name, $value )
setThirdPartyCookie ( $idVisitor ) Update the cookie information.
truncateCustomVariable ( $input )

Méthodes protégées

Méthode Description
authenticateTrackingApi ( $tokenAuth ) This method allows to set custom IP + server time + visitor ID, when using Tracking API.
getCookieExpire ( )
getCookieName ( )
getCookiePath ( )
getCurrentDate ( string $format = "Y-m-d" ) : string Returns the current date in the "Y-m-d" PHP format
getCustomTimestamp ( )
isTimestampValid ( $time, $now = null ) : boolean Returns true if the timestamp is valid ie. timestamp is sometime in the last 10 years and is not in the future.
makeThirdPartyCookieUID ( )
shouldUseThirdPartyCookie ( )

Private Methods

Méthode Description
hasParam ( $name )
truncateIdAsVisitorId ( $idVisitor ) : string

Method Details

__construct() public méthode

public __construct ( $params, boolean | string $tokenAuth = false )
$params
$tokenAuth boolean | string

authenticateSuperUserOrAdmin() public static méthode

public static authenticateSuperUserOrAdmin ( $tokenAuth, $idSite )

authenticateTrackingApi() protected méthode

These two attributes can be only set by the Super User (passing token_auth).
protected authenticateTrackingApi ( $tokenAuth )

getBrowserLanguage() public méthode

Returns the language the visitor is viewing.
public getBrowserLanguage ( ) : string
Résultat string browser language code, eg. "en-gb,en;q=0.5"

getCookieExpire() protected méthode

protected getCookieExpire ( )

getCookieName() protected méthode

protected getCookieName ( )

getCookiePath() protected méthode

protected getCookiePath ( )

getCurrentDate() protected méthode

Returns the current date in the "Y-m-d" PHP format
protected getCurrentDate ( string $format = "Y-m-d" ) : string
$format string
Résultat string

getCurrentTimestamp() public méthode

public getCurrentTimestamp ( )

getCustomTimestamp() protected méthode

protected getCustomTimestamp ( )

getCustomVariables() public méthode

Deprecation: since Piwik 2.10.0. Use Request::getCustomVariablesInPageScope() or Request::getCustomVariablesInVisitScope() instead. When we "remove" this method we will only set visibility to "private" and pass $parameter = _cvar|cvar as an argument instead of $scope
public getCustomVariables ( $scope )

getCustomVariablesInPageScope() public méthode

getCustomVariablesInVisitScope() public méthode

getDaysSinceFirstVisit() public méthode

public getDaysSinceFirstVisit ( ) : float | integer
Résultat float | integer

getDaysSinceLastOrder() public méthode

getDaysSinceLastVisit() public méthode

public getDaysSinceLastVisit ( ) : float | integer
Résultat float | integer

getForcedUserId() public méthode

public getForcedUserId ( )

getForcedVisitorId() public méthode

public getForcedVisitorId ( )

getGoalRevenue() public méthode

public getGoalRevenue ( $defaultGoalRevenue )

getIdSite() public méthode

public getIdSite ( )

getIp() public méthode

public getIp ( )

getIpString() public méthode

public getIpString ( ) : mixed | string
Résultat mixed | string

getLocalTime() public méthode

public getLocalTime ( ) : string
Résultat string

getMetadata() public méthode

Get a request metadata value. Returns null if none exists.
public getMetadata ( string $pluginName, string $key ) : mixed
$pluginName string eg, `'Actions'`, `'Goals'`, `'YourPlugin'`
$key string
Résultat mixed

getPageGenerationTime() public méthode

1 hour

getParam() public méthode

public getParam ( $name )

getParams() public méthode

public getParams ( )

getPlugins() public méthode

public getPlugins ( )

getRawParams() public méthode

Get the params that were originally passed to the instance. These params do not contain any params that were added within this object.
public getRawParams ( ) : array
Résultat array

getTokenAuth() public méthode

public getTokenAuth ( )

getUserAgent() public méthode

public getUserAgent ( )

getUserIdHashed() public méthode

Matches implementation of PiwikTracker::getUserIdHashed
public getUserIdHashed ( $userId ) : string
$userId
Résultat string

getVisitCount() public méthode

public getVisitCount ( ) : integer | mixed
Résultat integer | mixed

getVisitorId() public méthode

Returns the ID from the request in this order: return from a given User ID, or from a Tracking API forced Visitor ID, or from a Visitor ID from 3rd party (optional) cookies, or from a given Visitor Id from 1st party?
public getVisitorId ( )

isAuthenticated() public méthode

public isAuthenticated ( ) : boolean
Résultat boolean

isEmptyRequest() public méthode

public isEmptyRequest ( )

isTimestampValid() protected méthode

Returns true if the timestamp is valid ie. timestamp is sometime in the last 10 years and is not in the future.
protected isTimestampValid ( $time, $now = null ) : boolean
$time int Timestamp to test
$now int Current timestamp
Résultat boolean

makeThirdPartyCookieUID() protected méthode

protected makeThirdPartyCookieUID ( )

setCurrentTimestamp() public méthode

public setCurrentTimestamp ( $timestamp )

setMetadata() public méthode

Set a request metadata value.
public setMetadata ( string $pluginName, string $key, mixed $value )
$pluginName string eg, `'Actions'`, `'Goals'`, `'YourPlugin'`
$key string
$value mixed

setParam() public méthode

public setParam ( $name, $value )

setThirdPartyCookie() public méthode

Update the cookie information.
public setThirdPartyCookie ( $idVisitor )

shouldUseThirdPartyCookie() protected méthode

truncateCustomVariable() public static méthode

public static truncateCustomVariable ( $input )

Property Details

$isAuthenticated protected_oe property

protected $isAuthenticated

$params protected_oe property

protected array $params
Résultat array

$rawParams protected_oe property

protected $rawParams

$tokenAuth protected_oe property

protected $tokenAuth