PHP Класс TheIconic\Tracking\GoogleAnalytics\Analytics

The main interface for the clients, it relies heavily in magic methods exposing an interface with method tags. ==== GETTERS ==== General
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__call ( $methodName, array $methodArguments ) : mixed Routes the method call to the adequate private method.
__construct ( boolean $isSsl = false ) When passed with an argument of TRUE, it will send the hit using HTTPS instead of plain HTTP.
getUrl ( ) : string Build and returns URL used to send to Google Analytics.
makeNonBlocking ( ) Makes the request to GA asynchronous (non-blocking).
setAsyncRequest ( boolean $isAsyncRequest ) Sets a request to be either synchronous or asynchronous (non-blocking).
setDebug ( boolean $value ) : Analytics Sets debug mode to true or false.
setHttpClient ( HttpClient $httpClient ) Sets the HttpClient.

Приватные методы

Метод Описание
addItem ( $methodName, array $methodArguments ) Adds an item to a compund parameter collection.
fixTypos ( string $methodName ) : string Fix typos that went into releases, this way we ensure we don't break scripts in production.
getEndpoint ( ) : string Gets the full endpoint to GA.
getFullParameterClass ( $parameterClass, $methodName ) : string Gets the fully qualified name for a parameter.
getHttpClient ( ) : HttpClient Gets the HttpClient.
getIndexFromArguments ( $methodArguments ) : string Gets the index value from the arguments.
getParameter ( $methodName, array $methodArguments ) : string Gets the value for a parameter.
getParameterClassConstant ( $constant, $exceptionMsg ) : mixed Gets a contant from a class dynamically.
hasMinimumRequiredParameters ( ) : boolean Validates the minimum required parameters for every GA hit are being sent.
sendHit ( $methodName ) : AnalyticsResponse Sends a hit to GA. The hit will contain in the payload all the parameters added before.
setParameter ( $methodName, array $methodArguments ) Sets the value for a parameter.
setParameterActionTo ( $parameter, $action ) Sets a parameter action to the value specified by the method call.

Описание методов

__call() публичный Метод

Routes the method call to the adequate private method.
public __call ( $methodName, array $methodArguments ) : mixed
$methodName
$methodArguments array
Результат mixed

__construct() публичный Метод

It parses the available parameters.
public __construct ( boolean $isSsl = false )
$isSsl boolean

getUrl() публичный Метод

Build and returns URL used to send to Google Analytics.
public getUrl ( ) : string
Результат string

makeNonBlocking() публичный Метод

Makes the request to GA asynchronous (non-blocking).
Устаревший: Use setAsyncRequest(boolean $isAsyncRequest) instead. To be removed in next major version.
public makeNonBlocking ( )

setAsyncRequest() публичный Метод

Sets a request to be either synchronous or asynchronous (non-blocking).
public setAsyncRequest ( boolean $isAsyncRequest )
$isAsyncRequest boolean

setDebug() публичный Метод

Sets debug mode to true or false.
public setDebug ( boolean $value ) : Analytics
$value boolean
Результат Analytics

setHttpClient() публичный Метод

Sets the HttpClient.
public setHttpClient ( HttpClient $httpClient )
$httpClient TheIconic\Tracking\GoogleAnalytics\Network\HttpClient