We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93b3482 commit 9f76ed5Copy full SHA for 9f76ed5
1 file changed
src/pages/api/active-users.ts
@@ -79,8 +79,8 @@ async function fetchActiveUsersFromPostHog(): Promise<number | null> {
79
const url = `${posthogUrl}/api/projects/${projectId}/query/`
80
81
const now = new Date()
82
- const twentyFourHoursAgo = new Date(
83
- now.getTime() - 24 * 60 * 60 * 1000,
+ const sevenDaysAgo = new Date(
+ now.getTime() - 7 * 24 * 60 * 60 * 1000, // 7 days ago
84
).toISOString()
85
86
try {
@@ -97,7 +97,7 @@ async function fetchActiveUsersFromPostHog(): Promise<number | null> {
97
SELECT count(DISTINCT person_id) as recent_users
98
FROM events
99
WHERE event = '$pageview'
100
- AND timestamp > toDateTime('${twentyFourHoursAgo}')
+ AND timestamp > toDateTime('${sevenDaysAgo}')
101
`,
102
},
103
}),
0 commit comments