Skip to content

Instantly share code, notes, and snippets.

@tegansnyder
Created January 15, 2013 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tegansnyder/4535678 to your computer and use it in GitHub Desktop.
Save tegansnyder/4535678 to your computer and use it in GitHub Desktop.
Here is an example of how to track Mixpanel Revenue Data using PHP and HTTP Post methods.
<?php
$params = array(
'$append' => array(
'$transactions' => array(
'$time' => '2013-01-03T00:58:05',
'$amount' => 125.34
),
),
'$token' => 'YOUR_MIX_PANEL_TOKEN',
'$ip' => $_SERVER['REMOTE_ADDR'],
'$distinct_id' => "YOUR_UNIQUE_IDENTIFIER"
);
$url = 'http://api.mixpanel.com/engage/?data=' . base64_encode(json_encode($params));
exec("curl '" . $url . "' >/dev/null 2>&1 &");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment