Skip to content

Commit

Permalink
send millisecond precision timestamps (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredmixpanel authored Aug 10, 2022
1 parent 1c0b1fa commit c4b6245
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Producers/MixpanelEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function track($event, $properties = array()) {
if (!isset($properties["token"])) $properties['token'] = $this->_token;

// if no time is passed in, use the current time
if (!isset($properties["time"])) $properties['time'] = time();
if (!isset($properties["time"])) $properties['time'] = microtime(true);

$params['event'] = $event;
$params['properties'] = array_merge($this->_super_properties, $properties);
Expand Down
1 change: 1 addition & 0 deletions lib/Producers/MixpanelGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private function _constructPayload($group_key, $group_id, $operation, $value, $i
'$token' => $this->_token,
'$group_key' => $group_key,
'$group_id' => $group_id,
'$time' => microtime(true),
$operation => $value
);
if ($ignore_time === true) $payload['$ignore_time'] = true;
Expand Down
1 change: 1 addition & 0 deletions lib/Producers/MixpanelPeople.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private function _constructPayload($distinct_id, $operation, $value, $ip = null,
$payload = array(
'$token' => $this->_token,
'$distinct_id' => $distinct_id,
'$time' => microtime(true),
$operation => $value
);
if ($ip !== null) $payload['$ip'] = $ip;
Expand Down

0 comments on commit c4b6245

Please sign in to comment.