Skip to main content
Use identification to attach Pillow audience data to your website users. These methods are available on the SDK instance you initialize from @trypillow/web.

Set an external ID

Call setExternalId(...) after login or whenever you know who the current user is.
sdk.setExternalId('user_123');
The SDK persists this ID locally and reuses it across future browser sessions until you call reset().

Set user properties

Use setUserProperty(...) to store traits that you can use for targeting and analysis.
sdk.setUserProperty('plan', 'pro');
sdk.setUserProperty('email_verified', true);
sdk.setUserProperty('lifetime_value', 49.5);
Supported value types:
  • string
  • boolean
  • number

Remove properties

sdk.clearUserProperty('legacy_flag');
sdk.clearAllProperties();
Clearing properties updates the local browser state. Set new properties again when you want to target the user differently.

What’s next?

Studies

Present hosted studies once the user is identified.

Session management

Reset identity on logout and manage in-progress sessions.