PostscriptPostscript Developers
Guides

Identifying Users

Call identify() when you know who the user is — after login, form submission, or checkout. This links their anonymous browsing history to their profile.

Usage

sunrise.push(['identify', {
  email: '[email protected]',
  phone: '+15551234567',     // E.164 format
  external_id: 'cust_123'   // Your internal customer ID
}]);

Fields

FieldTypeDescription
emailstringEmail address — most important for marketing
phonestringPhone in E.164 format (e.g., +15551234567)
external_idstringYour internal customer/user ID

At least one identifier is required. Providing multiple identifiers improves profile matching accuracy.

When to Call

// Example: identify after a form submission
document.getElementById('signup-form').addEventListener('submit', (e) => {
  const email = e.target.querySelector('[name="email"]').value;
  sunrise.push(['identify', { email }]);
});

How It Works

When identify() is called, the SDK sends the identifiers to the Postscript identity resolution service, which:

  1. Finds or creates a profile matching the provided identifiers
  2. Merges any anonymous events from the current session into that profile
  3. Returns a resolved profile ID used for all subsequent events in the session