ParseAnalytics
in package
Class ParseAnalytics - Handles sending app-open and custom analytics events.
Tags
Table of Contents
- _toSaveJSON() : string
- Encodes and returns the given data as a json object
- track() : mixed
- Tracks the occurrence of a custom event with additional dimensions.
Methods
_toSaveJSON()
Encodes and returns the given data as a json object
public
static _toSaveJSON(array<string|int, mixed> $data) : string
Parameters
- $data : array<string|int, mixed>
-
Data to encode
Return values
string —track()
Tracks the occurrence of a custom event with additional dimensions.
public
static track(string $name[, array<string|int, mixed> $dimensions = [] ]) : mixed
Parse will store a data point at the time of invocation with the given event name.
Dimensions will allow segmentation of the occurrences of this custom event. Keys and values should be strings, and will throw otherwise.
To track a user signup along with additional metadata, consider the following:
$dimensions = array( 'gender' => 'm', 'source' => 'web', 'dayType' => 'weekend' ); ParseAnalytics::track('signup', $dimensions);
There is a default limit of 4 dimensions per event tracked.
Parameters
- $name : string
-
The name of the custom event
- $dimensions : array<string|int, mixed> = []
-
The dictionary of segment information