How to track signups in Next.js
The signup is the moment an anonymous visitor becomes a person. Get it right and every session before it retroactively belongs to a known customer; get it wrong and the whole pre-signup journey is orphaned forever.
Client event (fast, blockable) + server event (authoritative) → collapsed on the user id
Send it twice, on purpose. The client event tells you what the person did and when; the server event confirms it happened and carries the context the browser never had. A shared the user id collapses the two into one record marked confirmed by both sides.
Never send only the client event for anything with money attached — ad blockers see roughly 20–30% of paid-traffic sessions.
The server-side event
This is the one that has to be right. It runs on your infrastructure, so no ad blocker, browser policy or network condition can stop it.
// Server action — identify when the account actually exists
"use server";
export async function createAccount(formData: FormData) {
const user = await db.user.create({ data: { email: formData.get("email") as string } });
const anonymousId = cookies().get("_fsk_id")?.value;
await flowsk.identify({
anonymousId, email: user.email,
via: "signup_started", dedupKey: `user_${user.id}`, source: "server",
});
}
What goes wrong
Three mistakes account for nearly every broken signups implementation we see.
Identifying on form focus or keystroke instead of on confirmed creation, which pollutes your people table with typos.
Not recording *what caused* the identification, so you cannot tell a newsletter signup from a trial start.
Only identifying client-side, so an ad blocker means the join between anonymous and known never happens.
Frequently asked questions
Should I track signups client-side or server-side?
Both. The client event captures behaviour in real time and is cheap; the server event is authoritative and cannot be blocked. Give them a shared de-duplication key (the user id) and they collapse into one confirmed record instead of double counting.
What is the de-duplication key for signups in Next.js?
The user id — a value both sides already know. That is the whole requirement: the browser and your backend must be able to derive the same string independently.
What goes wrong most often?
Identifying on form focus or keystroke instead of on confirmed creation, which pollutes your people table with typos.
Why does the server event matter more here?
The signup is the moment an anonymous visitor becomes a person. Get it right and every session before it retroactively belongs to a known customer; get it wrong and the whole pre-signup journey is orphaned forever.
Related guides
See the receipt for every conversion.
Flowsk Signals stitches the anonymous click to the email to the purchase — first-party, server-side, de-duplicated on a key you choose. One snippet, $29/mo, and a journey you can inspect event by event.
More free tools
Same deal — instant, no signup.