Skip to content

Commit ab7af1d

Browse files
committed
Add id to events and tests
1 parent 07573d1 commit ab7af1d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@
10111011
if (event) {
10121012
sendData(
10131013
assign(eventParams, {
1014+
id: uuid(),
10141015
query: getQueryParams(!firstPage),
10151016
referrer:
10161017
(firstPage || sameSite) && collectMetricByString("r")

test/test-events.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ module.exports = async ({ os, browser }) => {
4242
"page_id",
4343
"session_id",
4444
"type",
45+
"id",
4546
]);
4647

48+
expect(
49+
UUIDvalidate(request.body.id, 4),
50+
"event id should be a valid UUIDv4"
51+
).to.be.true;
52+
4753
expect(
4854
UUIDvalidate(request.body.session_id, 4),
4955
"session_id should be a valid UUIDv4"

0 commit comments

Comments
 (0)