PHP 클래스 Piwik\Tracker\GoalManager

파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 메소드들

메소드 설명
detectGoalId ( $idSite, Request $request )
detectGoalMatch ( array $goal, Action $action ) : if Detects if an Action matches a given goal. If it does, the URL that triggered the goal is returned. Otherwise null is returned.
detectGoalsMatchingUrl ( integer $idSite, Action $action ) : array[] Look at the URL or Page Title and sees if it matches any existing Goal definition
detectIsThereExistingCartInVisit ( $visitInformation )
getGoalColumn ( $column )
getGoalDefinition ( $idSite, $idGoal )
getGoalDefinitions ( $idSite )
getGoalIds ( $idSite )
recordGoals ( Piwik\Tracker\Visit\VisitProperties $visitProperties, Request $request ) Records one or several goals matched in this request.

보호된 메소드들

메소드 설명
getItemRowCast ( array $row ) : array Casts the item array so that array comparisons work nicely
getItemRowEnriched ( $goal, $item )
getRevenue ( integer | float $revenue ) : integer | float Returns rounded decimal revenue, or if revenue is integer, then returns as is.
insertEcommerceItems ( array $goal, array $itemsToInsert ) : void Inserts in the cart in the DB the new items that were not previously in the cart
insertNewConversion ( array $conversion, array $visitInformation, Request $request ) : boolean Helper function used by other record* methods which will INSERT or UPDATE the conversion in the DB
isGoalPatternMatchingUrl ( $goal, $pattern_type, $url ) : boolean
isUrlMatchingGoal ( $goal, $pattern_type, $url ) : boolean
recordEcommerceGoal ( Piwik\Tracker\Visit\VisitProperties $visitProperties, Request $request, array $conversion, Action $action ) Records an Ecommerce conversion in the DB. Deals with Items found in the request.
recordEcommerceItems ( array $goal, array $items ) : integer Loads the Ecommerce items from the request and records them in the DB
recordStandardGoals ( Piwik\Tracker\Visit\VisitProperties $visitProperties, Request $request, $goal, Action $action ) Records a standard non-Ecommerce goal in the DB (URL/Title matching), linking the conversion to the action that triggered it
updateEcommerceItems ( array $goal, array $itemsToUpdate ) : void Updates the cart items in the DB that have been modified since the last cart update

비공개 메소드들

메소드 설명
getCleanedEcommerceItems ( array $items ) : array Reads items from the request, then looks up the names from the lookup table and returns a clean array of items ready for the database.
getEcommerceItemsFromRequest ( Request $request ) : array | boolean Returns Items read from the request string
getGoalFromVisitor ( Piwik\Tracker\Visit\VisitProperties $visitProperties, Request $request, $action )
getModel ( )
triggerHookOnDimensions ( Request $request, Piwik\Plugin\Dimension\ConversionDimension[] $dimensions, string $hook, Piwik\Tracker\Visitor $visitor, Action | null $action, array | null $valuesToUpdate ) : array | null

메소드 상세

detectGoalId() 공개 메소드

public detectGoalId ( $idSite, Request $request )
$request Request

detectGoalMatch() 공개 메소드

Detects if an Action matches a given goal. If it does, the URL that triggered the goal is returned. Otherwise null is returned.
public detectGoalMatch ( array $goal, Action $action ) : if
$goal array
$action Action
리턴 if a goal is matched, a string of the Action URL is returned, or if no goal was matched it returns null

detectGoalsMatchingUrl() 공개 메소드

Look at the URL or Page Title and sees if it matches any existing Goal definition
public detectGoalsMatchingUrl ( integer $idSite, Action $action ) : array[]
$idSite integer
$action Action
리턴 array[] Goals matched

detectIsThereExistingCartInVisit() 공개 메소드

public detectIsThereExistingCartInVisit ( $visitInformation )

getGoalColumn() 공개 메소드

public getGoalColumn ( $column )

getGoalDefinition() 공개 정적인 메소드

public static getGoalDefinition ( $idSite, $idGoal )

getGoalDefinitions() 공개 정적인 메소드

public static getGoalDefinitions ( $idSite )

getGoalIds() 공개 정적인 메소드

public static getGoalIds ( $idSite )

getItemRowCast() 보호된 메소드

Casts the item array so that array comparisons work nicely
protected getItemRowCast ( array $row ) : array
$row array
리턴 array

getItemRowEnriched() 보호된 메소드

protected getItemRowEnriched ( $goal, $item )

getRevenue() 보호된 메소드

Returns rounded decimal revenue, or if revenue is integer, then returns as is.
protected getRevenue ( integer | float $revenue ) : integer | float
$revenue integer | float
리턴 integer | float

insertEcommerceItems() 보호된 메소드

Inserts in the cart in the DB the new items that were not previously in the cart
protected insertEcommerceItems ( array $goal, array $itemsToInsert ) : void
$goal array
$itemsToInsert array
리턴 void

insertNewConversion() 보호된 메소드

Helper function used by other record* methods which will INSERT or UPDATE the conversion in the DB
protected insertNewConversion ( array $conversion, array $visitInformation, Request $request ) : boolean
$conversion array
$visitInformation array
$request Request
리턴 boolean

isGoalPatternMatchingUrl() 보호된 메소드

protected isGoalPatternMatchingUrl ( $goal, $pattern_type, $url ) : boolean
$goal
$pattern_type
$url
리턴 boolean

isUrlMatchingGoal() 보호된 메소드

protected isUrlMatchingGoal ( $goal, $pattern_type, $url ) : boolean
$goal
$pattern_type
$url
리턴 boolean

recordEcommerceGoal() 보호된 메소드

Will deal with 2 types of conversions: Ecommerce Order and Ecommerce Cart update (Add to cart, Update Cart etc).
protected recordEcommerceGoal ( Piwik\Tracker\Visit\VisitProperties $visitProperties, Request $request, array $conversion, Action $action )
$visitProperties Piwik\Tracker\Visit\VisitProperties
$request Request
$conversion array
$action Action

recordEcommerceItems() 보호된 메소드

Loads the Ecommerce items from the request and records them in the DB
protected recordEcommerceItems ( array $goal, array $items ) : integer
$goal array
$items array
리턴 integer Number of items in the cart

recordGoals() 공개 메소드

Records one or several goals matched in this request.
public recordGoals ( Piwik\Tracker\Visit\VisitProperties $visitProperties, Request $request )
$visitProperties Piwik\Tracker\Visit\VisitProperties
$request Request

recordStandardGoals() 보호된 메소드

Records a standard non-Ecommerce goal in the DB (URL/Title matching), linking the conversion to the action that triggered it
protected recordStandardGoals ( Piwik\Tracker\Visit\VisitProperties $visitProperties, Request $request, $goal, Action $action )
$visitProperties Piwik\Tracker\Visit\VisitProperties
$request Request
$goal
$action Action

updateEcommerceItems() 보호된 메소드

Updates the cart items in the DB that have been modified since the last cart update
protected updateEcommerceItems ( array $goal, array $itemsToUpdate ) : void
$goal array
$itemsToUpdate array
리턴 void