Jethro85 commited on
Commit ·
bfe2ef7
1
Parent(s): 2085299
log to supabase
Browse files- app/templates/base.html +5 -5
app/templates/base.html
CHANGED
|
@@ -86,15 +86,15 @@
|
|
| 86 |
window.__visitor_id = getVisitorId();
|
| 87 |
window.__session_id = getSessionId();
|
| 88 |
|
| 89 |
-
function track(
|
| 90 |
-
fetch('/track', {
|
| 91 |
method: 'POST',
|
| 92 |
headers: { 'Content-Type': 'application/json' },
|
| 93 |
body: JSON.stringify({
|
| 94 |
-
|
|
|
|
|
|
|
| 95 |
...props,
|
| 96 |
-
visitor_id: window.__visitor_id,
|
| 97 |
-
session_id: window.__session_id,
|
| 98 |
})
|
| 99 |
});
|
| 100 |
}
|
|
|
|
| 86 |
window.__visitor_id = getVisitorId();
|
| 87 |
window.__session_id = getSessionId();
|
| 88 |
|
| 89 |
+
function track(eventType, props = {}) {
|
| 90 |
+
fetch('/api/track', {
|
| 91 |
method: 'POST',
|
| 92 |
headers: { 'Content-Type': 'application/json' },
|
| 93 |
body: JSON.stringify({
|
| 94 |
+
eventType,
|
| 95 |
+
vid: window.__visitor_id,
|
| 96 |
+
sessionId: window.__session_id,
|
| 97 |
...props,
|
|
|
|
|
|
|
| 98 |
})
|
| 99 |
});
|
| 100 |
}
|