Cohorts
Activations
Contextual
What are Cohorts?
Cohort Types
What are Activations?
Available Activation Types
Cohorts vs. Activations
In the SDK, access cohorts viacohorts and activations via activations.
Example:
Accessing Cohorts and Activations
- Get Cohorts
- Get Activations
- Reactive Updates
Get all cohorts the user currently belongs to:
Async API
Requires SDK v3.0.0+. These methods use Swift concurrency (
async/await) and are available in Swift only.cohorts(), activations(), and googleCustomTargeting(adTargetable:) - wait for cohorts and activations to settle (for any events still being processed) before returning the current values. If they don’t settle within a short timeout (defaults to 500ms), the methods fall back to the currently cached values.
This matters most for time-sensitive ad requests: after tracking the page a user just opened, you want the ad request’s targeting to reflect that page rather than the previous one. Awaiting googleCustomTargeting(adTargetable:) gives the new cohorts a brief window to settle, then builds targeting from the freshest values available.
Get cohorts, awaiting any pending events:
Use Cases
Personalization
Personalization
Feature Flags / A/B Testing
Feature Flags / A/B Testing
Dynamic Ad Targeting
Dynamic Ad Targeting
Activations are used with ad targeting:
Analytics and Logging
Analytics and Logging
Contextual Cohorts
Contextual cohorts are generated in real-time based on content being viewed. They require SDK version 2.0.0+ and feature enablement by your CSM.Contextual Data Guide
Complete contextual cohorts documentation
tvOS Considerations
tvOS Note: Cohorts and activations work identically on tvOS. The same APIs are available, and cohort data syncs across all Apple platforms when identity is set.
Troubleshooting
Empty cohorts
Empty cohorts
Problem:
cohorts returns an empty set.Solutions:- Wait a few seconds after initialization
- Track some events to generate data
- Use TriggerProvider for reactive updates
- Enable debug logging to see sync status
- Verify cohorts are configured in your dashboard
Activations different from cohorts
Activations different from cohorts
Problem: User is in a cohort but it doesn’t appear in activations.Cause: Not all cohorts are activated for all platforms. This is configured in your Permutive dashboard.Solution: Check your dashboard configuration or contact your Customer Success Manager.
Contextual cohorts not appearing
Contextual cohorts not appearing
Problem:
dfp_contextual activations are empty.Solutions:- Verify feature is enabled with your CSM
- Update to SDK 2.0.0+
- Ensure you’re using PageTracker with valid URLs
- Verify the URL is publicly accessible
- Check debug logs for classification errors
Best Practices
- Do
- Don't
- Use
cohortsfor one-time checks - Use TriggerProvider for reactive updates
- Check activation keys exist before accessing
- Handle empty sets gracefully
- Log cohorts for debugging (in development only)
- Cache cohort checks that are expensive to re-evaluate
Related Documentation
Triggers Provider
Reactive cohort updates
Contextual Data
Content-based segmentation
Google Ad Manager
GAM integration
Xandr Integration
AppNexus integration