Why Use UserContext?
- A/B Testing: Enable sophisticated targeting rules for experiments
- Session Consistency: User context’s targeting key ensures the same user always gets the same experience across sessions
- Personalization: Pass user attributes to customize graph behavior
What Happens Without UserContext?
Without UserContext: The system uses a single default targeting key for all requests, causing 100% of users to get assigned to the same variant instead of distributing according to your configured splits (50/50, 30/70, etc.).How to Use UserContext
Basic Usage
Schema
Common Attributes
Attributes are flexible key-value pairs. Common examples:user_id: Primary user identifierage: User age for demographic targetingcountry: Country code (‘US’, ‘CA’, ‘UK’)user_tier: Subscription level (‘free’, ‘premium’)app_version: Version of your application
Next Steps
Experiments
Learn how to register your graphs and run A/B experiments
Experiments
Learn best practices for A/B experiments