PHP Class Jetpack_Tracks_Client, jetpack

显示文件 Open project: automattic/jetpack Class Usage Examples

Public Methods

Method Description
build_pixel_url ( array $event ) : string Build an event and return its tracking URL
build_timestamp ( ) Milliseconds since 1970-01-01
get_anon_id ( ) : string Grabs the user's anon id from cookies, or generates and sets a new one
get_connected_user_tracks_identity ( ) : array | boolean Gets the WordPress.com user's Tracks identity, if connected.
get_user_agent ( )
record_event ( mixed $event ) : mixed record_event
record_pixel ( $pixel ) Synchronously request the pixel

Private Methods

Method Description
validate_and_sanitize ( array $event ) : mixed Validate input for a tracks event.

Method Details

build_pixel_url() static public method

Build an event and return its tracking URL
Deprecation: Call the `build_pixel_url` method on a Jetpack_Tracks_Event object instead.
static public build_pixel_url ( array $event ) : string
$event array Event keys and values
return string URL of a tracking pixel

build_timestamp() static public method

Milliseconds since 1970-01-01
static public build_timestamp ( )

get_anon_id() static public method

Grabs the user's anon id from cookies, or generates and sets a new one
static public get_anon_id ( ) : string
return string An anon id for the user

get_connected_user_tracks_identity() static public method

Gets the WordPress.com user's Tracks identity, if connected.

get_user_agent() static public method

static public get_user_agent ( )

record_event() static public method

record_event
static public record_event ( mixed $event ) : mixed
$event mixed Event object to send to Tracks. An array will be cast to object. Required. Properties are included directly in the pixel query string after light validation.
return mixed True on success, WP_Error on failure

record_pixel() static public method

Synchronously request the pixel
static public record_pixel ( $pixel )