mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-08 20:25:19 +02:00
feat: add PostHog last_seen_at property
This commit is contained in:
parent
f92567acd8
commit
3dbae2d278
1 changed files with 9 additions and 0 deletions
|
|
@ -12,6 +12,15 @@ if (process.env.NEXT_PUBLIC_POSTHOG_KEY) {
|
|||
capture_pageview: "history_change",
|
||||
// Enable session recording
|
||||
capture_pageleave: true,
|
||||
before_send: (event) => {
|
||||
if (event.properties) {
|
||||
event.properties.$set = {
|
||||
...event.properties.$set,
|
||||
last_seen_at: new Date().toISOString(),
|
||||
};
|
||||
}
|
||||
return event;
|
||||
},
|
||||
loaded: (posthog) => {
|
||||
// Expose PostHog to window for console access and toolbar
|
||||
if (typeof window !== "undefined") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue