Explore Server Side Testing SDK for PHP

Tracker

Table of Contents

Constants

EVENT_PAGE_VIEW  = 'view'
VERSION  = 'sdk-php-1.0.0'
VERSION_TIMESTAMP  = "1742042660"
VISITOR_TYPE_NEW  = 'new'
VISITOR_TYPE_RETURNING  = 'returning'

Properties

$client  : ExploreClient
$context  : Context
$httpClient  : HttpClientInterface
$logger  : LoggerInterface
$userProvider  : UserProviderInterface

Methods

__construct()  : mixed
setClient()  : self
Set the client
setContext()  : self
Set the context
track()  : mixed
Track a goal
trackPageView()  : mixed
Track a page view
trackVariationView()  : mixed
Track a variation view
buildLastVariation()  : string
Build the last variation string
getCommonParams()  : array<string|int, mixed>
Get the common params
getGoalParams()  : mixed
Get the goal params
getPageViewParams()  : array<string|int, mixed>
Get the page view params
getVariationViewParams()  : array<string|int, mixed>
Get the variation view params
validateDependencies()  : mixed
Validate that client and context are set

Constants

EVENT_PAGE_VIEW

public mixed EVENT_PAGE_VIEW = 'view'

VERSION

public mixed VERSION = 'sdk-php-1.0.0'

VERSION_TIMESTAMP

public mixed VERSION_TIMESTAMP = "1742042660"

VISITOR_TYPE_NEW

public mixed VISITOR_TYPE_NEW = 'new'

VISITOR_TYPE_RETURNING

public mixed VISITOR_TYPE_RETURNING = 'returning'

Properties

$logger

private LoggerInterface $logger

Methods

setContext()

Set the context

public setContext(Context $context) : self
Parameters
$context : Context
Return values
self

track()

Track a goal

public track(string $goalName, string|float $goalValue[, array<string|int, mixed>|null $details = null ][, ExploreClient|null $client = null ][, Context|null $context = null ][, array<string|int, mixed>|null $decisionList = null ]) : mixed
Parameters
$goalName : string
$goalValue : string|float
$details : array<string|int, mixed>|null = null

Optional details (skus array / transaction string)

$client : ExploreClient|null = null

Optional client override

$context : Context|null = null

Optional context override

$decisionList : array<string|int, mixed>|null = null

Optional decision list override

Tags
throws
TrackerException

trackPageView()

Track a page view

public trackPageView(string $page[, ExploreClient|null $client = null ][, Context|null $context = null ]) : mixed
Parameters
$page : string
$client : ExploreClient|null = null

Optional client override

$context : Context|null = null

Optional context override

Tags
throws
TrackerException

trackVariationView()

Track a variation view

public trackVariationView([array<string|int, mixed>|null $decisionList = null ][, ExploreClient|null $client = null ][, Context|null $context = null ]) : mixed
Parameters
$decisionList : array<string|int, mixed>|null = null

Optional decision list override

$client : ExploreClient|null = null

Optional client override

$context : Context|null = null

Optional context override

Tags
throws
TrackerException

buildLastVariation()

Build the last variation string

private buildLastVariation(array<string|int, mixed> $decisionList) : string
Parameters
$decisionList : array<string|int, mixed>
Return values
string

getGoalParams()

Get the goal params

private getGoalParams(ExploreClient $client, Context $context, string $lastVariation, string $goalName, mixed $goalValue[, array<string|int, mixed>|null $details = null ]) : mixed
Parameters
$client : ExploreClient
$context : Context
$lastVariation : string
$goalName : string
$goalValue : mixed
$details : array<string|int, mixed>|null = null

getPageViewParams()

Get the page view params

private getPageViewParams(ExploreClient $client, Context $context, string $page) : array<string|int, mixed>
Parameters
$client : ExploreClient
$context : Context
$page : string
Return values
array<string|int, mixed>

getVariationViewParams()

Get the variation view params

private getVariationViewParams(ExploreClient $client, Context $context, string $variation) : array<string|int, mixed>
Parameters
$client : ExploreClient
$context : Context
$variation : string
Return values
array<string|int, mixed>

validateDependencies()

Validate that client and context are set

private validateDependencies([ExploreClient|null $client = null ][, Context|null $context = null ]) : mixed
Parameters
$client : ExploreClient|null = null
$context : Context|null = null
Tags
throws
InvalidArgumentException

        
On this page

Search results