PHP 클래스 Piwik\Tracker\Visit

A visit is either NEW or KNOWN. - If a visit is NEW then we process the visitor information (settings, referrers, etc.) and save a new line in the log_visit table. - If a visit is KNOWN then we update the visit row in the log_visit table, updating the number of pages views, time spent, etc. Whether a visit is NEW or KNOWN we also save the action in the DB. One request to the piwik.php script is associated to one action.
상속: implements Piwik\Tracker\VisitInterface
파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dimensions

보호된 프로퍼티들

프로퍼티 타입 설명
$goalManager GoalManager
$request Request
$requestProcessors Piwik\Tracker\RequestProcessor[]
$userSettings Piwik\Tracker\Settings
$visitProperties Piwik\Tracker\Visit\VisitProperties

공개 메소드들

메소드 설명
__construct ( )
generateUniqueVisitorId ( ) : string
handle ( ) Main algorithm to handle the visit.
isHostKnownAliasHost ( $urlHost, $idSite ) is the host any of the registered URLs for this website?
setRequest ( Request $request )

보호된 메소드들

메소드 설명
getAllVisitDimensions ( )
getSettingsObject ( ) : Piwik\Tracker\Settings Gets the UserSettings object
getTimeSpentReferrerAction ( ) : integer
getVisitorIdcookie ( ) : string Returns visitor cookie
getVisitorIp ( ) : string Returns the visitor's IP address
handleExistingVisit ( $visitIsConverted ) In the case of a known visit, we have to do the following actions:
handleNewVisit ( boolean $visitIsConverted ) In the case of a new visit, we have to do the following actions:
insertNewVisit ( $visit )
updateExistingVisit ( $valuesToUpdate )

비공개 메소드들

메소드 설명
getExistingVisitFieldsToUpdate ( $visitIsConverted ) : array Gather fields=>values that needs to be updated for the existing visit in log_visit
getModel ( )
getTimezoneForSite ( $idSite )
getVisitStandardLength ( )
makeVisitorFacade ( )
markArchivedReportsAsInvalidIfArchiveAlreadyFinished ( )
printVisitorInformation ( )
setIdVisitorForExistingVisit ( $valuesToUpdate ) : mixed
setNewVisitorInformation ( )
toCanonicalHost ( $host )
triggerHookOnDimensions ( Piwik\Plugin\Dimension\VisitDimension[] $dimensions, string $hook, array | null $valuesToUpdate = null ) : array | null
triggerPredicateHookOnDimensions ( $dimensions, $hook )

메소드 상세

__construct() 공개 메소드

public __construct ( )

generateUniqueVisitorId() 공개 정적인 메소드

public static generateUniqueVisitorId ( ) : string
리턴 string returns random 16 chars hex string

getAllVisitDimensions() 보호된 메소드

protected getAllVisitDimensions ( )

getSettingsObject() 보호된 메소드

Gets the UserSettings object
protected getSettingsObject ( ) : Piwik\Tracker\Settings
리턴 Piwik\Tracker\Settings

getTimeSpentReferrerAction() 보호된 메소드

protected getTimeSpentReferrerAction ( ) : integer
리턴 integer Time in seconds

getVisitorIdcookie() 보호된 메소드

Returns visitor cookie
protected getVisitorIdcookie ( ) : string
리턴 string binary

getVisitorIp() 보호된 메소드

Returns the visitor's IP address
protected getVisitorIp ( ) : string
리턴 string

handle() 공개 메소드

Once we have the visitor information, we have to determine if the visit is a new or a known visit. 1) When the last action was done more than 30min ago, or if the visitor is new, then this is a new visit. 2) If the last action is less than 30min ago, then the same visit is going on. Because the visit goes on, we can get the time spent during the last action. NB: - In the case of a new visit, then the time spent during the last action of the previous visit is unknown. - In the case of a new visit but with a known visitor, we can set the 'returning visitor' flag. In all the cases we set a cookie to the visitor with the new information.
public handle ( )

handleExistingVisit() 보호된 메소드

1) Insert the new action 2) Update the visit information
protected handleExistingVisit ( $visitIsConverted )
$visitIsConverted

handleNewVisit() 보호된 메소드

1) Insert the new action 2) Insert the visit information
protected handleNewVisit ( boolean $visitIsConverted )
$visitIsConverted boolean

insertNewVisit() 보호된 메소드

protected insertNewVisit ( $visit )

isHostKnownAliasHost() 공개 정적인 메소드

is the host any of the registered URLs for this website?
public static isHostKnownAliasHost ( $urlHost, $idSite )

setRequest() 공개 메소드

public setRequest ( Request $request )
$request Request

updateExistingVisit() 보호된 메소드

protected updateExistingVisit ( $valuesToUpdate )
$valuesToUpdate

프로퍼티 상세

$dimensions 공개적으로 정적으로 프로퍼티

public static $dimensions

$goalManager 보호되어 있는 프로퍼티

protected GoalManager,Piwik\Tracker $goalManager
리턴 GoalManager

$request 보호되어 있는 프로퍼티

protected Request,Piwik\Tracker $request
리턴 Request

$requestProcessors 보호되어 있는 프로퍼티

protected RequestProcessor[],Piwik\Tracker $requestProcessors
리턴 Piwik\Tracker\RequestProcessor[]

$userSettings 보호되어 있는 프로퍼티

protected Settings,Piwik\Tracker $userSettings
리턴 Piwik\Tracker\Settings

$visitProperties 보호되어 있는 프로퍼티

protected VisitProperties,Piwik\Tracker\Visit $visitProperties
리턴 Piwik\Tracker\Visit\VisitProperties