PHP Class Segment

Afficher le fichier Open project: segmentio/analytics-php Class Usage Examples

Méthodes publiques

Méthode Description
alias ( array $message ) : boolean Aliases the user id from a temporary id to a permanent one
flush ( ) Flush the client
group ( array $message ) : boolean Tags traits about the group.
identify ( array $message ) : boolean Tags traits about the user.
init ( string $secret, array $options = [] ) Initializes the default client to use. Uses the socket consumer by default.
page ( array $message ) : boolean Tracks a page view
screen ( array $message ) : boolean Tracks a screen view
track ( array $message ) : boolean Tracks a user action
validate ( array $msg, string $type ) Validate common properties.

Private Methods

Méthode Description
assert ( array $value, string $msg ) Assert value or throw.
checkClient ( ) Check the client.

Method Details

alias() public static méthode

Aliases the user id from a temporary id to a permanent one
public static alias ( array $message ) : boolean
$message array
Résultat boolean whether the alias call succeeded

flush() public static méthode

Flush the client
public static flush ( )

group() public static méthode

Tags traits about the group.
public static group ( array $message ) : boolean
$message array
Résultat boolean whether the group call succeeded

identify() public static méthode

Tags traits about the user.
public static identify ( array $message ) : boolean
$message array
Résultat boolean whether the identify call succeeded

init() public static méthode

Initializes the default client to use. Uses the socket consumer by default.
public static init ( string $secret, array $options = [] )
$secret string your project's secret key
$options array passed straight to the client

page() public static méthode

Tracks a page view
public static page ( array $message ) : boolean
$message array
Résultat boolean whether the page call succeeded

screen() public static méthode

Tracks a screen view
public static screen ( array $message ) : boolean
$message array
Résultat boolean whether the screen call succeeded

track() public static méthode

Tracks a user action
public static track ( array $message ) : boolean
$message array
Résultat boolean whether the track call succeeded

validate() public static méthode

Validate common properties.
public static validate ( array $msg, string $type )
$msg array
$type string