Skip to content

Commit 8ce4cdb

Browse files
authored
Merge pull request #8 from AlexWestergaard/v1.x
Update timestamp to microtime format
2 parents dbf77c7 + 29540f3 commit 8ce4cdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Analytics.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ public function setUserId(string $id)
8080
}
8181

8282
/**
83-
* @param int|float $microOrUnix
83+
* @param int|float $microOrUnix time() or microtime(true)
8484
*/
8585
public function setTimestamp($microOrUnix)
8686
{
8787
if (!is_numeric($microOrUnix)) {
8888
throw new GA4Exception("setTimestamp value must be numeric");
8989
}
9090

91-
$this->timestamp_micros = floor($microOrUnix * 1000);
91+
$this->timestamp_micros = floor($microOrUnix * 1000000);
9292
return $this;
9393
}
9494

0 commit comments

Comments
 (0)