mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Feat/um 305 unique session ch (#2065)
* Add session_data / session redis to CH. * Add mysql migration.
This commit is contained in:
parent
1038a54fe4
commit
b484286523
23 changed files with 405 additions and 300 deletions
|
|
@ -173,7 +173,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
const send = payload => {
|
||||
const send = (payload, type = 'event') => {
|
||||
if (trackingDisabled()) return;
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
}
|
||||
return fetch(endpoint, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ type: 'event', payload }),
|
||||
body: JSON.stringify({ type, payload }),
|
||||
headers,
|
||||
})
|
||||
.then(res => res.text())
|
||||
|
|
@ -205,11 +205,14 @@
|
|||
return send(getPayload());
|
||||
};
|
||||
|
||||
const identify = data => send({ ...getPayload(), data }, 'identify');
|
||||
|
||||
/* Start */
|
||||
|
||||
if (!window.umami) {
|
||||
window.umami = {
|
||||
track,
|
||||
identify,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue