Audience Segmentation Engine
See it in the demo — Target the right users with segments and rules (~60s)Discover and target customer segments automatically with eight built-in templates that find high-value customers, at-risk users and growth opportunities.
What You'll Learn
What is Audience Segmentation?
Audience segmentation helps you identify groups of customers with similar characteristics, behaviors, or risks. Instead of treating all customers the same, you can target specific segments with personalized campaigns and interventions.
BillDog's Segment Discovery runs eight rule-based templates over your customer data and shows which ones match customers — high-value customers, subscribers at risk, dormant accounts and more — saving you hours of manual analysis.
1Access Segment Discovery
Navigate to your BillDog dashboard and find the Targeting section in the main menu.
- Log in to your BillDog dashboard
- Select your project from the project selector
- Click on Targeting in the sidebar
- Click Segment Discovery
2Run Segment Discovery
Click the "Discover Segments" button to run the templates. BillDog will analyze your customer data and identify valuable segments based on:
Behavioral Patterns
- Tracked event count
- Days since last activity
- User onboarding stage
Financial Metrics
- Lifetime value (LTV)
- Purchase frequency
- Average order value
Risk Indicators
- Days since last seen
- Health score trends
- Engagement decline
Subscription Status
- Active subscribers
- Trial users
- Cancelled customers
subscription_status comes from the subscriptions on that customer’s own record, and falls back to none when there are none. A member of a BillDog Auth organization inherits the organization’s entitlements only through their session token, so a paid seat can read none here. Segment on the organization’s customer for account-level questions — see Organizations.
Template-based discovery
The discovery process typically takes 5-15 seconds depending on your customer base size. BillDog checks all eight templates and lists the ones that have customers.
3Review Discovered Segments
Once discovery completes, you'll see a list of segments with key information:
Segment Cards Show:
- •Segment Name: e.g., "High-Value Customers" or "At-Risk Users"
- •Description: What defines this segment
- •Customer Count: How many customers match this segment
- •Business Value: High, Medium, or Low priority
- •Confidence Score: how large the segment is relative to your customer base (up to 95%)
Common Discovered Segments:
High-Value Customers
Top 20% of customers by lifetime value. These are your most valuable users.
Subscribers at Risk
Subscribers whose store reports a billing issue, a grace period, or auto-renew turned off while still paid through the period. This is observed subscription state, not a prediction: BillDog does not compute a churn-risk score.
Most Active Users
Active subscribers with 50+ tracked events over their lifetime. Great candidates for upsells or referral programs.
Trial Users
Users currently on trial. Focus on conversion campaigns before trial ends.
Organization seats are separate customers
Discovery reads one row per customer from customer_analytics, and every condition it writes is evaluated against that customer’s own record. A BillDog Auth organization has a customer record of its own, and a member’s entitlements are the union of their personal ones and the organization’s — but the inherited half exists only in the ent claim of their session token and is never written onto their customer row. A paying seat can therefore look unentitled to anything reading the customer record: with no subscription of their own they miss Most Active Users, which requires an active subscription alongside 50+ tracked events. When the question is about the account rather than the person, segment on the organization’s customer. See Organizations.
4Activate Segments
When you find a valuable segment, click the "Activate Segment" button to promote it to an active targeting segment. Once activated, you can:
- 1Create targeted campaigns specifically for this customer group
- 2Monitor segment performance over time with dedicated analytics
- 3Export customer lists for use in email campaigns or ad targeting
- 4Set up automated actions when customers enter or leave the segment
Real-World Use Cases
💰 Increase Revenue from High-Value Customers
Segment: High-Value Customers (Top 20% LTV)
Action: Offer exclusive features, early access to new products, or premium support
🚨 Reduce Churn from At-Risk Customers
Segment: Subscribers at Risk (billing issue, grace period or cancelled), Dormant Users or Lapsed Subscribers
Action: Send personalized re-engagement emails, offer discounts, or schedule check-in calls
🔄 Reactivate Dormant Users
Segment: Dormant Users (30+ days inactive)
Action: Send "We miss you" campaigns with special offers or feature highlights
🎯 Convert Trial Users
Segment: Trial Users (Currently on trial with high engagement)
Action: Send conversion-focused messages highlighting key benefits and offer launch discount
Best Practices
- 📊
Run discovery regularly
Segment weekly or after major product changes to identify new patterns
- 🎯
Focus on high-value segments first
Prioritize segments marked as "High" business value for maximum impact
- ✅
Validate segment quality
Check confidence scores and customer counts before activating
- 🔄
Monitor segment performance
Track how segments evolve over time and adjust campaigns accordingly
- 🧪
Test different approaches
A/B test campaigns for each segment to find what works best
Developer & Database Reference
For developers building custom integrations, querying segment memberships programmatically, or working with edge functions.
1. Database Schema Reference
BillDog analytics segments and scoring data are backed by the following database views and tables in Supabase:
customer_analytics (View)
Unified customer telemetry with behavioral and financial aggregations.
id: uuid -- Customer unique identifier project_id: uuid -- Project reference app_user_id: text -- App-specific user ID email: text -- User email address display_name: text -- User profile name first_seen_at: timestamptz -- First tracked activity last_seen_at: timestamptz -- Last tracked activity days_since_first_seen: int -- Calculated duration since onboarding days_since_last_seen: int -- Days since last activity session_count: int -- Lifetime count of tracked events (not sessions) ltv_usd: numeric -- Lifetime value in USD purchase_count: int -- Total purchase transactions avg_purchase_value: numeric -- Average revenue per transaction subscription_status: text -- active | trial | canceled | grace_period | billing_retry | paused | expired | refunded | access_restricted | none custom_attributes: jsonb -- Custom client properties
auto_discovered_segments
Template-discovered segments waiting for promotion or active tracking.
project_id: uuid -- References project name: text -- Recommended segment name description: text -- Cohort description / rationale segment_type: text -- behavioral | financial | risk | engagement conditions: jsonb -- Target rules matching executeSegmentQuery customer_count: int -- Number of matching customers confidence_score: numeric -- Segment size relative to the customer base (0-95) business_value: text -- Value impact level (high | medium | low) discovered_at: timestamptz -- Discovery execution timestamp promoted_to_segment_id: uuid -- Promoted active segment reference (nullable) is_active: boolean -- True if segment is running
2. Query Builder Functions
Retrieve or estimate segment sizes using the matching query engine functions:
import { executeSegmentQuery } from '@/lib/segmentQueryBuilder';
// Query customers with active subscriptions and LTV > $100
const { customers, count } = await executeSegmentQuery(
'your-project-uuid',
[
{
id: 'rule-1',
field: 'ltv_usd',
operator: 'greater_than',
value: 100
},
{
id: 'rule-2',
field: 'subscription_status',
operator: 'equals',
value: 'active'
}
]
);
console.log(`Found ${count} active VIP customers.`);3. Segment Discovery Edge Function
Trigger segment analysis and generation by invoking the database-level edge function:
curl -i -X POST "https://api.billdog.io/functions/v1/discover-segments" \
-H "Authorization: Bearer YOUR_ANON_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "your-project-uuid"
}'Next Steps
Now that you understand audience segmentation, explore these related features:
Was this page helpful?
Or rate this page: