summaryrefslogtreecommitdiffstats
path: root/pages/cp.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-03-24 11:41:06 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-03-24 11:41:06 -0700
commit41acac169cf71b9912a20ffe336dc685b221d74c (patch)
tree74e8679ca3588630963c3141a855198fe696cc39 /pages/cp.php
parent04a2320f85a024d0b795956c95c41c7320aff9c5 (diff)
downloadpathery-41acac169cf71b9912a20ffe336dc685b221d74c.tar.xz
Prep work for server-end mixpanel tracking for unsubscribe to prevent a desynch status of 'unsubscribed'
Diffstat (limited to 'pages/cp.php')
-rw-r--r--pages/cp.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/pages/cp.php b/pages/cp.php
index d8fa2ba..8ce922e 100644
--- a/pages/cp.php
+++ b/pages/cp.php
@@ -6,6 +6,24 @@ htmlHeader();
<?php
+//TODO: Switch to a http request instead of curl
+// class mixpanelTracker {
+ // public $token = '24743c6567f831ddfcbbbd3f397e11e4';
+ // public $host = 'http://api.mixpanel.com/';
+ // public function __construct() {
+ // }
+ // function set($distinct_id, $properties=array()) {
+ // $params = array(
+ // '$token' => $this->token,
+ // '$distinct_id' => $distinct_id,
+ // '$set' => $properties
+ // );
+ // $url = $this->host . 'engage/?verbose=1&data=' . base64_encode(json_encode($params));
+ // exec("curl '" . $url . "' >/dev/null 2>&1 &");
+ // }
+// }
+
+
topbar($Links);
if (!$accepted) {
@@ -85,6 +103,9 @@ if (isset($_POST['updateSettings']) AND $_POST['updateSettings'] == 'true') {
setOptedOutOfEmails($userID, false);
$r .= "<br />You are accepting emails";
$r .= '<script>mixpanel.people.set("$unsubscribed", false);</script>';
+
+ //$metrics = new mixpanelTracker($mpToken);
+ //$metrics->set(10, array('$unsubscribed'=>false));
}
DoRedirect($r);
exit;