feat: listen analytics — track who heard what and when
Add listen_events table to record opens, plays and listen duration per share link. Public POST/PATCH endpoints for fire-and-forget tracking from the listen page; authenticated GET analytics endpoint aggregates per version. Listen page gains optional name prompt after first play and sendBeacon on unload. Track page gains Analytics tab with stats grid and per-listener event list. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,3 +8,10 @@ export const subscribePushSchema = z.object({
|
||||
}),
|
||||
userAgent: z.string().optional(),
|
||||
});
|
||||
|
||||
export const updateListenEventSchema = z.object({
|
||||
listenerName: z.string().max(255).optional(),
|
||||
firstPlay: z.boolean().optional(),
|
||||
listenSeconds: z.number().int().min(0).optional(),
|
||||
completed: z.boolean().optional(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user