Identity and Privacy
The SDK separates session, authenticated-user, and optional device identity. None of these identifiers should be shared across merchant workspaces.
Identity layers
| Identifier | Source | Behavior |
|---|---|---|
session_id | SDK session manager | Always present; rotates after the configured inactivity timeout or reset. |
user_id | Your identify() call | Optional merchant-scoped authenticated user ID. |
device_id | SDK device identity | Always present as a random persistent ID; opt-in fingerprinting can replace it with a fingerprint-derived ID. |
Identify a user after your storefront authentication succeeds:
window.upsurge.identify('customer_48291', {
customer_segment: 'loyalty_member',
});
On logout or account switching:
window.upsurge.reset();
Do not use email addresses, phone numbers, postal addresses, IP addresses, or other direct identifiers as browser event properties. Use your merchant-scoped user ID and consented, non-sensitive traits.
Do Not Track
Set respectDoNotTrack: true if your privacy policy treats the browser DNT preference as an opt-out. When DNT is present, the SDK disables tracking during initialization.
Fingerprinting
Fingerprinting is implemented but disabled by default. Enable it only after your legal and consent requirements are satisfied:
window.UpsurgeQueue.push([
'init',
{
siteId: 'site_replace_me',
baseUrl: 'https://dashboard.upsur.ge',
enableFingerprinting: true,
},
]);
Use window.upsurge.clearFingerprint() after consent withdrawal. isFingerprintingEnabled() reports the configured runtime state.
Profile personalization
Profile personalization helpers accept a curated merchant-scoped field set such as first name, display name, preferences, loyalty tier, lifecycle stage, value bands, and recent product/category IDs. They require consent metadata or an existing consent grant reference.
The SDK removes raw email, phone, address, location, and IP-shaped fields from personalization updates before queueing. A clear operation without explicit grant metadata is treated as consent withdrawal for merchant personalization.
Use server-side governed imports for sensitive identity processing; do not attempt to reconstruct cross-merchant identity in the browser.