Segmentation

Audience segments let you group contacts by behavior, properties, or events. Segments update in real time as new data flows in.

Creating a segment

Create segments from the dashboard at CRM > Audiences, or via the CLI:

gurulu audiences create \
  --site-id YOUR_SITE_ID \
  --name "Power Users" \
  --rules '{"events":{"name":"pageview","count":{"gte":50},"period":"30d"}}'

Rule types

Segments support these rule types:

  • Event-based -- users who performed event X at least N times
  • Property-based -- users with property X equal to Y
  • Page-based -- users who visited specific pages
  • Recency -- users active within the last N days
  • Source-based -- users from a specific referrer or UTM

Rules can be combined with AND/OR logic. Nested groups are supported.

Dynamic evaluation

Segments are evaluated dynamically. When a contact triggers a new event or updates a property, their segment memberships are recalculated automatically. There is no manual refresh needed.

Using segments

Segments can be used across Gurulu features:

  • Filter analytics dashboards by segment
  • Target experiments to specific segments
  • Send webhook events when users enter/exit a segment
  • Export segment members via API

API access

curl -H "Authorization: Bearer gsk_live_..." \
  "https://gurulu.io/api/cli/audiences?siteId=YOUR_SITE_ID"