diff --git a/lib/Producers/MixpanelEvents.php b/lib/Producers/MixpanelEvents.php index 3a76b2e..16cfaab 100644 --- a/lib/Producers/MixpanelEvents.php +++ b/lib/Producers/MixpanelEvents.php @@ -27,10 +27,10 @@ public function track($event, $properties = array()) { // if no time is passed in, use the current time if (!array_key_exists('time', $properties)) $properties['time'] = time(); - $params['event'] = $event; $params['properties'] = array_merge($this->_super_properties, $properties); + $this->enqueue($params); } @@ -120,7 +120,8 @@ public function getProperty($property) { * @param string|int $user_id */ public function identify($user_id) { - $this->register("distinct_id", $user_id); + $this->register('distinct_id', $user_id); + $this->register('$user_id', $user_id); } @@ -161,4 +162,4 @@ public function createAlias($original_id, $new_id) { function _getEndpoint() { return $this->_options['events_endpoint']; } -} \ No newline at end of file +} diff --git a/lib/Producers/MixpanelPeople.php b/lib/Producers/MixpanelPeople.php index bf7d431..d7f3089 100644 --- a/lib/Producers/MixpanelPeople.php +++ b/lib/Producers/MixpanelPeople.php @@ -18,6 +18,7 @@ private function _constructPayload($distinct_id, $operation, $value, $ip = null, $payload = array( '$token' => $this->_token, '$distinct_id' => $distinct_id, + '$user_id' => $distinct_id, $operation => $value ); if ($ip !== null) $payload['$ip'] = $ip;