Lead Generation Funnel Architecture

Complete Meta Ad to CRM Pipeline

A comprehensive lead generation system with embedded quiz, TCPA consent tracking, SMS verification, and automatic CRM integration.

TCPA Compliant

Full consent tracking with IP, timestamp, and user agent capture

SMS Verification

Twilio-powered phone verification with 6-digit codes

Auto CRM Sync

Automatic lead creation in Pipedrive after verification

Complete Funnel Flow

1
Meta Ad Click

User sees ad on Facebook/Instagram

User Action

  • • Clicks "Learn More" on Meta ad
  • • Lands on Trusty Scout homepage
  • • Sees trust indicators and testimonials

Goal

  • • Build credibility and trust
  • • Educate about final expense insurance
  • • Drive to quiz CTA
2
Embedded Quiz

Multi-step qualification form

Questions Asked

  • • Age range
  • • Coverage amount needed
  • • Health status

Data Captured

  • • Quiz responses (JSON)
  • • Qualification score
  • • Timestamp

UX Features

  • • Progress bar
  • • Back navigation
  • • Validation feedback
3
Contact Information & TCPA Consent

Compliant lead capture

Information Collected

RequiredFull Name
RequiredEmail Address
RequiredPhone Number
RequiredTCPA Consent Checkbox

TCPA Compliance Data

Consent Timestamp: Exact date/time
IP Address: User's IP (IPv4/IPv6)
User Agent: Browser & device info
Disclosure: Full SMS terms displayed
Opt-out: STOP keyword instructions
4
SMS Verification (Twilio)

Phone number validation

Verification Process

  1. 1.Generate random 6-digit code
  2. 2.Store code in database with 10-min expiration
  3. 3.Send SMS via Twilio API
  4. 4.User enters code on verification screen
  5. 5.Validate code and mark lead as verified

SMS Message Format

"Your Trusty Scout verification code is: 123456. This code expires in 10 minutes. Reply STOP to opt out."

✓ Clear sender identification
✓ Code prominently displayed
✓ Expiration notice
✓ Opt-out instructions
5
Pipedrive CRM Integration

Automatic lead creation

Step 1: Create Person

Name: Full name from form
Email: Primary email address
Phone: Verified phone number
Returns Person ID

Step 2: Create Lead

Title: "Final Expense Insurance - [Name]"
Person ID: From step 1
Value: Estimated from coverage amount
Custom Fields: Quiz responses, age, health
Returns Lead ID

Database Update

After successful Pipedrive sync, the lead record is updated with pipedrivePersonId and pipedriveLeadId for future reference and tracking.

Lead Successfully Captured!

Ready for agent follow-up

Email Sent

Confirmation to lead

CRM Updated

Lead in Pipedrive

Agent Notified

Ready to contact

Technical Implementation

Frontend Stack
Framework:React 19 + TypeScript
Styling:Tailwind CSS 4
UI Components:shadcn/ui
Routing:Wouter
API Client:tRPC + React Query
Backend Stack
Runtime:Node.js + Express
API Layer:tRPC 11
Database:MySQL + Drizzle ORM
SMS Service:Twilio API
CRM Integration:Pipedrive API
Database Schema: Leads Table
FieldTypePurpose
idVARCHAR(36)Primary key (nanoid)
fullNameVARCHAR(255)Lead's full name
emailVARCHAR(320)Email address
phoneVARCHAR(20)Phone number
ageINTAge from quiz
coverageAmountVARCHAR(50)Desired coverage range
quizResponsesTEXTJSON of all quiz answers
tcpaConsentINT1 = consented, 0 = not
tcpaConsentTimestampTIMESTAMPWhen consent was given
tcpaConsentIpVARCHAR(45)User's IP address
tcpaConsentUserAgentTEXTBrowser/device info
smsVerificationCodeVARCHAR(6)6-digit verification code
smsVerificationSentAtTIMESTAMPWhen code was sent
smsVerificationExpiresAtTIMESTAMPCode expiration (10 min)
smsVerifiedINT1 = verified, 0 = not
smsVerifiedAtTIMESTAMPWhen phone was verified
pipedrivePersonIdINTPipedrive Person ID
pipedriveLeadIdVARCHAR(36)Pipedrive Lead ID
createdAtTIMESTAMPRecord creation time
updatedAtTIMESTAMPLast update time

Ready to Deploy?

The complete funnel is built and tested. Add your Pipedrive and Twilio credentials to go live.