Skip to Content

Leads

Sources

Leads flow into the CRM from:

SourceMechanism
Website formsTenant embeds a script or webhook URL in their contact form
Facebook Lead AdsAuto-captured via Meta Webhooks when a lead form is submitted
Google Ads Lead Form ExtensionsVia Google Ads API or webhook
Manual entryDM team or tenant manually adds a lead
CSV importBulk import via file upload

Data model

leads

Contacts captured from any source.

ColumnTypeNotes
tenant_iduuid FK → tenants
sourceenumwebsite_form | facebook_lead_ad | google_lead_form | manual | import | other
source_channel_iduuid FK → channelsNULL for manual/import
source_campaign_iduuid FK → ad_campaignsNULL unless from a paid campaign
first_namevarchar(255)
last_namevarchar(255)
emailvarchar(255)
phonevarchar(50)
companyvarchar(255)
job_titlevarchar(255)
messagetextMessage from form or lead ad answers
source_urlvarchar(1000)Landing page or ad URL
utm_sourcevarchar(255)
utm_mediumvarchar(255)
utm_campaignvarchar(255)
statusenumnew | contacted | qualified | disqualified | converted
score_totalintegerCurrent lead score from 0-100
score_bandenumcold | warm | hot
score_versionvarchar(50)Scoring model version, e.g. v1.0
score_updated_ontimestamptzLast scoring update timestamp
disqualification_reasontext
assigned_touuid FK → users
enrichment_datajsonb{ linkedinUrl, companySize, industry, website }
notestext
last_activity_ontimestamptz
nurture_statusenumnot_enrolled | active | paused | completed | exited
current_sequence_iduuid FK → lead_nurture_sequencesNULL when not enrolled
next_nurture_step_ontimestamptzNext scheduled nurture step

Indexes

CREATE INDEX idx_leads_tenant_status ON leads(tenant_id, status, created_on); CREATE INDEX idx_leads_source ON leads(tenant_id, source, source_campaign_id); CREATE INDEX idx_leads_score ON leads(tenant_id, score_total DESC, status, last_activity_on DESC); CREATE INDEX idx_leads_nurture_next_step ON leads(tenant_id, nurture_status, next_nurture_step_on);

Enrichment

When a new lead is captured, an optional auto-enrichment step runs to look up company info, LinkedIn profile, and other firmographic data. The result is stored in enrichment_data (jsonb) and an enrichment activity is logged on the lead’s timeline.

Scoring snapshot

The lead row stores the latest score snapshot (score_total, score_band, score_version, score_updated_on) for fast filtering and ranking. Detailed factor-level score breakdowns are stored separately (see lead-scoring.md).

Nurture sequence state

The lead row stores only the current nurture execution state for scheduling and queue pickup. Sequence definitions and per-step execution logs are stored in dedicated nurture tables (see nurture-sequences.md).

© 2026 Leadmetrics — Internal use only