Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-smush.../vendor/mixpanel/mixpanel.../examples
File: all_calls.php
<?php
[0] Fix | Delete
require_once("/path/to/vendor/mixpanel/mixpanel-php/lib/Mixpanel.php"); // import the Mixpanel class
[1] Fix | Delete
[2] Fix | Delete
$mp = new Mixpanel("MIXPANEL_PROJECT_TOKEN", array(
[3] Fix | Delete
"debug" => true,
[4] Fix | Delete
));
[5] Fix | Delete
[6] Fix | Delete
// this would likely come from a database or session variable
[7] Fix | Delete
$user_id = 12345;
[8] Fix | Delete
[9] Fix | Delete
// associate user 12345 to all subsequent track calls
[10] Fix | Delete
$mp->identify($user_id);
[11] Fix | Delete
[12] Fix | Delete
// send property "color" = "red" with all subsequent track calls
[13] Fix | Delete
$mp->register("color", "red");
[14] Fix | Delete
[15] Fix | Delete
// send property "number" = 1 with all subsequent track calls, don't overwrite an existing value
[16] Fix | Delete
$mp->registerOnce("number", 1);
[17] Fix | Delete
$mp->registerOnce("number", 2); // this will do nothing
[18] Fix | Delete
[19] Fix | Delete
// send all of these properties with all subsequent track calls, overwriting previously set values
[20] Fix | Delete
$mp->registerAll(array("color" => "green", "prop2" => "val2")); // color is now green instead of red
[21] Fix | Delete
[22] Fix | Delete
// send all of these properties with all subsequent track calls, NOT overwriting previously set values
[23] Fix | Delete
$mp->registerAllOnce(array("color" => "blue", "prop3" => "val3")); // color is still green but prop3 is now set to val3
[24] Fix | Delete
[25] Fix | Delete
// track a custom "button click" event
[26] Fix | Delete
$mp->track("button click", array("label" => "Login"));
[27] Fix | Delete
[28] Fix | Delete
// track a custom "logged in" event
[29] Fix | Delete
$mp->track("logged in", array("landing page" => "/specials"));
[30] Fix | Delete
[31] Fix | Delete
// create/update a profile identified by id 12345 with $first_name set to John and $email set to john.doe@example.com
[32] Fix | Delete
// now we can send them Notifications!
[33] Fix | Delete
$mp->people->set($user_id, array(
[34] Fix | Delete
'$first_name' => "John",
[35] Fix | Delete
'$email' => "john.doe@example.com"
[36] Fix | Delete
));
[37] Fix | Delete
[38] Fix | Delete
// update John's profile with property ad_source to be "google" but don't override ad_source if it exists already
[39] Fix | Delete
$mp->people->setOnce($user_id, array("ad_source" => "google"));
[40] Fix | Delete
[41] Fix | Delete
// increment John's total logins by one
[42] Fix | Delete
$mp->people->increment($user_id, "login count", 1);
[43] Fix | Delete
[44] Fix | Delete
// append a new favorite to John's favorites
[45] Fix | Delete
$mp->people->append($user_id, "favorites", "Apples");
[46] Fix | Delete
[47] Fix | Delete
// append a few more favorites to John's favorites
[48] Fix | Delete
$mp->people->append($user_id, "favorites", array("Baseball", "Reading"));
[49] Fix | Delete
[50] Fix | Delete
// track a purchase or charge of $9.99 for user 12345 where the transaction happened just now
[51] Fix | Delete
$mp->people->trackCharge($user_id, "9.99");
[52] Fix | Delete
[53] Fix | Delete
// track a purchase or charge of $20 for user 12345 where the transaction happened on June 01, 2013 at 5pm EST
[54] Fix | Delete
$mp->people->trackCharge($user_id, "20.00", strtotime("01 Jun 2013 5:00:00 PM EST"));
[55] Fix | Delete
[56] Fix | Delete
// clear all purchases for user 12345
[57] Fix | Delete
$mp->people->clearCharges($user_id);
[58] Fix | Delete
[59] Fix | Delete
// delete the profile for user 12345
[60] Fix | Delete
$mp->people->deleteUser($user_id);
[61] Fix | Delete
[62] Fix | Delete
// create an alias for user 12345 (note that this is done synchronously)
[63] Fix | Delete
$mp->createAlias($user_id, "johndoe1");
[64] Fix | Delete
[65] Fix | Delete
// track an even using the alias
[66] Fix | Delete
$mp->track("logout", array("distinct_id" => "johndoe1"));
[67] Fix | Delete
[68] Fix | Delete
// manually put messages on the queue (useful for batch processing)
[69] Fix | Delete
$mp->enqueueAll(array(
[70] Fix | Delete
array("event" => "test"),
[71] Fix | Delete
array("event" => "test2")
[72] Fix | Delete
));
[73] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function