mixpanel/php-sdk

Mixpanel PHP SDK

dev-master 2012-06-17 07:18 UTC

This package is auto-updated.

Last update: 2024-11-29 04:35:45 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);