Commit f2044b58 authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

web: fix newsletter signup

parent d53988f6
...@@ -6,12 +6,22 @@ const analytics = new Analytics({ writeKey: process.env.TELEMETRY_WRITE_KEY || ' ...@@ -6,12 +6,22 @@ const analytics = new Analytics({ writeKey: process.env.TELEMETRY_WRITE_KEY || '
export async function POST(req: Request) { export async function POST(req: Request) {
const { email } = await req.json() const { email } = await req.json()
analytics.identify({ const id = uuid()
anonymousId: uuid(),
await analytics.identify({
anonymousId: id,
traits: { traits: {
email, email,
}, },
}) })
await analytics.track({
anonymousId: id,
event: 'signup',
properties: {
email,
},
})
return new Response(null, { status: 200 }) return new Response(null, { status: 200 })
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment