Skip to main content
Cohorts are the core mechanism for user segmentation in Permutive. The SDK provides methods to check cohort membership and react to changes in real-time.

What are Cohorts

Activations

SDK Methods

What are Cohorts

Cohort Types

How Cohorts Work

  1. Events are tracked via the SDK (pageviews, custom events, etc.)
  2. Rules are evaluated against user behavior
  3. Users enter/exit cohorts based on rule matching
  4. Cohorts are stored locally in the browser
  5. 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

Use ready() with the 'realtime' stage to ensure cohort data is available:

Real-Time Triggers

React to cohort changes as they happen:
See Real-Time Triggers for more details.

localStorage Structure

Cohorts are stored in localStorage for fast access and ad targeting:
Always use the SDK methods (segments(), segment()) rather than reading localStorage directly in production code. The SDK handles synchronization and edge cases.

Using Cohorts with Ad Platforms

Prebid.js

Cohorts are automatically passed to Prebid via the RTD module. See Prebid Integration.

AppNexus/Xandr

Cohort Patterns

Event-Based Cohort Updates

Cohorts update in real-time as users take actions:

Debugging Cohorts

Enable debug mode to see cohort activity:
Console output includes:

Troubleshooting

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)
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
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')
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

Real-Time Triggers

React to cohort changes

Custom Cohorts

Build cohorts in dashboard

Contextual Cohorts

Content-based cohorts

Google Ad Manager

GAM targeting setup