identify() & advanced matching

Tell AdsPing who the visitor is once — every later event inherits the identity automatically, on this page and on future visits.

What identify() does

One call, two effects:

  • This session — the identity joins pb.js's advanced-matching pool, so every later adsping('track', …) call carries it automatically. You don't repeat user data on each event.
  • Future events — AdsPing also stores the identity server-side against the visitor. Later events from the same visitor (even on another day) are enriched with it before being forwarded, which is what lifts your Event Match Quality.

Call it whenever you learn who the visitor is: after login, after signup, or when a form is submitted.

Usage

js
adsping('identify', {
  email:     '[email protected]',
  phone:     '+1 415 555 1234',
  firstName: 'Jane',
  lastName:  'Doe',
  city:      'San Francisco'
});

Send only what you actually have — a lone email is already the strongest match signal. Every personal field is SHA-256 hashed before it reaches any destination; Meta, TikTok and Google only ever receive the hash.

Fields

FieldFormatExample
emailEmail address, any case.[email protected]
phoneAny format — normalized to E.164 by country.+1 415 555 1234
firstNameGiven name, plain text.Jane
lastNameFamily name, plain text.Doe
cityCity name, plain text.San Francisco

You can pass the other match fields too (state, zipCode, country, dateOfBirth, gender, externalId) — they join the advanced-matching pool for this session and ride along on every later event.

What's captured automatically

pb.js already harvests identity without any identify() call:

  • Form inputs — email and phone are picked up as the visitor types into recognizable fields (works with SPA forms that never fire a native submit).
  • Click ids & cookiesfbclid / gclid / ttclid from the URL, fbp / fbc cookies.
  • Existing tags — values your site already passes to fbq('init', …) are mirrored in.
So when do you need identify()? When the identity lives where pb.js can't see it: your auth session, your backend's user object, a CRM id. One call after login covers the whole visit.

If a visitor declines tracking consent, tell pb.js:

js
adsping('consent', 'revoke');  // visitor opted out
adsping('consent', 'grant');   // visitor opted (back) in
  • After revoke, every event is flagged with Meta's Limited Data Use (data_processing_options: ["LDU"]) so Meta restricts how the data is processed.
  • The choice is persisted in a first-party cookie (_pb_consent, ~13 months) — you call it once from your consent banner, not on every page.

Was this page helpful?