Lead Scoring & Lifecycle Stages
Lead Scoring
OM_LeadScoring assigns points to subscribers based on behaviour. The cumulative lead_score column on om_subscribers tracks total points.
Default Rules
| Event | Points |
|---|---|
email_open | +1 |
email_click | +2 |
form_submit | +5 |
page_visit | +3 |
purchase | +10 |
tag_added | +3 |
unsubscribe | −20 |
bounce | −10 |
Rules are stored in om_lead_score_rules and editable in the admin.
php// Score a subscriber for an event
OM_LeadScoring::score( $subscriber_id, 'email_click' );
// Get current score
$score = OM_LeadScoring::get_score( $subscriber_id );
// Add custom points directly
OM_LeadScoring::add_points( $subscriber_id, 25, 'manual_award' );
// Get the configured points for an event type
$pts = OM_LeadScoring::get_points_for( 'form_submit' ); // returns int
Scoring fires: do_action( 'om_lead_score_updated', $subscriber_id, $old_score, $new_score )
Lifecycle Stages
OM_Lifecycle tracks where each subscriber is in the customer journey.
Default Stages
| Stage | Color | Default Sort |
|---|---|---|
| Lead | #94a3b8 | 1 |
| Subscriber | #3b82f6 | 2 |
| Engaged | #8b5cf6 | 3 |
| Customer | #f59e0b | 4 |
| Advocate | #10b981 | 5 |
| Churned | #ef4444 | 6 |
Auto-transition Rules — each stage can have JSON rules that automatically move a subscriber forward:
php// Auto-rule conditions
'lead_score_gte' // lead score >= value
'lead_score_lte' // lead score <= value
'total_purchases_gte' // WooCommerce purchase count >= value
'engagement_score_gte' // engagement score >= value
'days_since_subscribe_gte' // days since signup >= value
'has_tag' // subscriber has tag (slug)
php// Manually move a subscriber to a stage
OM_Lifecycle::set_stage( $subscriber_id, 'customer' );
// Get current stage
$stage = OM_Lifecycle::get_stage( $subscriber_id ); // returns slug string