StageUp
Web SDKEvents

User Properties Management

Track user traits to enable personalization and targeted segmentation.

🔍 User Identification

Persistent User Tracking

Link sessions to a known user after login:

AdStage.events.setUserId('user_12345');
const userId = AdStage.events.getUserId();
console.log('Current user ID:', userId);

Anonymous Users

Unauthenticated users are tracked anonymously (session scoped). No manual setup required.

👤 Setting User Properties

Standard Properties

AdStage.events.setUserProperties({
  age: '25',
  gender: 'female', // 'male' | 'female' | 'other' | 'unknown'
  country: 'KR',
  city: 'Seoul',
  language: 'ko-KR'
});

Custom per‑field setters are not provided; always pass a full partial object.

Auto Collected Properties

// navigator.language → language & country inference
const info = AdStage.events.getUserInfo();
console.log(info); // { language: 'ko-KR', country: 'KR' }

Timezone inference occurs internally and is not exposed separately.

Unsupported Custom Properties

Only the standard schema is stored. Use event parameters for additional context:

AdStage.events.track('user_profile_updated', {
  subscription_tier: 'premium',
  account_type: 'business',
  last_login: '2024-01-15'
});

📊 Managing Properties

const current = AdStage.events.getUserProperties();
console.log('User properties:', current);
 
// Reset (clear all user props)
AdStage.events.setUserProperties({});

Regional Overrides

const autoInfo = AdStage.events.getUserInfo();
AdStage.events.setUserProperties({
  country: 'KR',
  city: 'Seoul',
  language: 'ko-KR'
});

🎯 Personalization Examples

function personalizeContent() {
  const props = AdStage.events.getUserProperties();
  if (props.age && parseInt(props.age) < 30) showYoungAdultContent();
  if (props.country === 'KR') showKoreanContent();
  if (props.language?.startsWith('ko')) setKoreanLanguage();
}
 
AdStage.events.setUserProperties({ country: 'KR', language: 'ko-KR', age: '28' });
personalizeContent();

🔗 Event Inclusion

All tracked events automatically include user properties.

AdStage.events.track('page_view', { page: 'product_detail', product_id: 'prod_123' });
// Server payload shape (conceptual):
// {
//   eventName: 'page_view',
//   user: { gender, country, city, age, language },
//   params: { ... }
// }

▶️ Next Steps

Table of Contents