File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ function generateRandomId() {
99
99
return ethers . hexlify ( ethers . randomBytes ( 24 ) )
100
100
}
101
101
102
+ // using property based sessions instead of the default time based https://docs.mixpanel.com/docs/features/sessions#property-based-sessions
103
+ const session_id = generateRandomId ( )
104
+
102
105
/**
103
106
* An internal only function that adds context and global properties to the
104
107
* event payload before sending.
@@ -121,7 +124,8 @@ async function _trackEventPrivate(
121
124
[ idFieldName ] : id ,
122
125
properties : {
123
126
...properties ,
124
- OS : getFormattedOsName ( )
127
+ OS : getFormattedOsName ( ) ,
128
+ session_id
125
129
} ,
126
130
context : {
127
131
app : {
@@ -167,7 +171,8 @@ export const trackScreen = async (name: string, properties?: apiObject) => {
167
171
name,
168
172
properties : {
169
173
...( properties ?? { } ) ,
170
- OS : getFormattedOsName ( )
174
+ OS : getFormattedOsName ( ) ,
175
+ session_id
171
176
} ,
172
177
context : {
173
178
app : {
You can’t perform that action at this time.
0 commit comments