tracker.trackSignUp()
Fires a GA4 sign_up event. When conversionLabels.signUp is configured, also fires a matching Ads conversion.
Signature
Section titled “Signature”tracker.trackSignUp(input?: BrowserSignUpInput): Promise<void>;BrowserSignUpInput
Section titled “BrowserSignUpInput”type BrowserSignUpInput = { transactionId?: string; method?: string; userData?: UserData;};| Field | Required | Notes |
|---|---|---|
transactionId | no | Auto-generated when missing; standard dual-send-disabled warning fires. |
method | no | The sign-up provider — 'email', 'google', 'github', etc. Maps to GA4’s method param. |
userData | no | Hashed per enhanced conversions when supplied. Pass email here so Ads enhanced-conversions matching has something to work with — sign-up is one of the highest-leverage moments to capture identity. |
Returns
Section titled “Returns”Promise<void>.
Example
Section titled “Example”'use client';import { tracker } from '@/lib/tracker.client';import { useTracker } from '@trackbridge/sdk/next';
export function SignUpForm() { return ( <form onSubmit={async (e) => { e.preventDefault(); const user = await api.signUp(/* ... */);
tracker.identifyUser(user.id); await tracker.trackSignUp({ transactionId: user.id, method: 'email', userData: { email: user.email }, }); }} > {/* ... */} </form> );}Calling identifyUser(user.id) before trackSignUp ensures any subsequent GA4 events on this session attribute to the new user.