Created
January 15, 2013 03:00
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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