mixpanel/php-sdk

Mixpanel PHP SDK

Maintainers

Package info

github.com/rodchyn/mixpanel-php

Homepage

pkg:composer/mixpanel/php-sdk

Statistics

Installs: 1 258

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-03-01 00:18:58 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);