What are Cohorts
Activations
SDK Methods
What are Cohorts
Cohort Types
How Cohorts Work
- Events are tracked via the SDK (pageviews, custom events, etc.)
- Rules are evaluated against user behavior
- Users enter/exit cohorts based on rule matching
- Cohorts are stored locally in the browser
- Cohorts are passed to ad platforms for targeting
Activations
Activation Types
Cohorts vs Activations
Accessing Cohorts
Get All Segments
Get Platform-Specific Segments
Check Single Cohort Membership
Wait for Cohort Data
Useready() with the 'realtime' stage to ensure cohort data is available:
Real-Time Triggers
React to cohort changes as they happen:localStorage Structure
Cohorts are stored in localStorage for fast access and ad targeting:| Key | Purpose |
|---|---|
_psegs | All cohorts |
_pdfps | Google Ad Manager (DFP) activations |
_papns | AppNexus activations |
_prubicons | Rubicon activations |
_ppubmatics | PubMatic activations |
Using Cohorts with Ad Platforms
Google Ad Manager
Prebid.js
Cohorts are automatically passed to Prebid via the RTD module. See Prebid Integration.AppNexus/Xandr
Cohort Patterns
- Personalization
- Paywall
- A/B Testing
- Analytics
Event-Based Cohort Updates
Cohorts update in real-time as users take actions:Debugging Cohorts
Enable debug mode to see cohort activity:Troubleshooting
segments() returns empty array
segments() returns empty array
Problem: No cohorts even after tracking events.Solutions:
- Use
ready('realtime')to wait for data - Check that events are being tracked (debug mode)
- Verify cohorts are configured in dashboard
- Ensure user hasn’t opted out (consent)
- Allow time for cohort processing (seconds to minutes)
User doesn't enter expected cohort
User doesn't enter expected cohort
Problem: Events tracked but user not in cohort.Solutions:
- Verify cohort rules in dashboard
- Check event properties match rule conditions
- Confirm cohort is active (not paused/archived)
- Check cohort minimum threshold/frequency
Activations not matching cohorts
Activations not matching cohorts
Problem: User in cohort but activation array differs.Solutions:
- Check that cohort is activated for the platform
- Verify activation configuration in dashboard
- Use correct type parameter:
segments(cb, 'dfp')
Stale cohort data
Stale cohort data
Problem: Cohorts not updating after new events.Solutions:
- Cohorts update in real-time but may take a few seconds
- Refresh page to trigger re-evaluation
- Check that new events are actually being tracked
- Use
trigger()for real-time change detection
Related Documentation
Real-Time Triggers
React to cohort changes
Custom Cohorts
Build cohorts in dashboard
Contextual Cohorts
Content-based cohorts
Google Ad Manager
GAM targeting setup