serverTracker.trackSignUp()
Server-side sign_up. Most useful when sign-up completion happens server-side (account confirmation, OAuth callback) rather than in a client form submission.
Signature
Section titled “Signature”serverTracker.trackSignUp(input: ServerSignUpInput): Promise<ServerHelperResult>;ServerSignUpInput
Section titled “ServerSignUpInput”type ServerSignUpInput = { transactionId?: string; method?: string; clientId: string; userId?: string; gclid?: string; gbraid?: string; wbraid?: string; userData?: UserData; consent?: ServerConsent;};| Field | Required | Notes |
|---|---|---|
transactionId | no | Auto-generated when missing. Use user.id for dual-send with the browser-side call. |
method | no | The sign-up provider ('email', 'google', …). GA4 method param. |
clientId | yes | GA4 client ID. |
userId | no | The new user’s ID; sets GA4 user_id. |
gclid / gbraid / wbraid | no | Click identifiers. |
userData | no | Sign-up is a high-leverage moment to hash email for Ads enhanced conversions. |
consent | no | Per-call consent. |
Returns
Section titled “Returns”Promise<ServerHelperResult> — same shape as trackPurchase.
Example
Section titled “Example”export async function POST(req: Request) { const { email, password, gaClientId, gclid } = await req.json(); const user = await createAccount({ email, password });
await serverTracker.trackSignUp({ transactionId: user.id, method: 'email', clientId: gaClientId, userId: user.id, gclid, userData: { email: user.email }, });
return Response.json({ user });}