mixpanel / php-sdk
Mixpanel PHP SDK
Installs: 1 257
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >=5.2.0
- ext-curl: *
- ext-json: *
This package is auto-updated.
Last update: 2024-10-29 04:14:33 UTC
README
Library include two classes
Mixpanel - for data requests.
MetricsTracker - to track program events
Example usage
MetricsTracker
$metrics = new MetricsTracker("YOUR_TOKEN");
$metrics->track('purchase', array('item'=>'candy', 'type'=>'snack', 'ip'=>'123.123.123.123'));
Mixpanel
$api_key = 'your key';
$api_secret = 'your secret';
$mp = new Mixpanel($api_key, $api_secret);
$data = $mp->request(array('events', 'properties'), array(
'event' => 'pages',
'name' => 'page',
'type' => 'unique',
'unit' => 'day',
'interval' => '20',
'limit' => '20'
));
var_dump($data);