Stop Calling Every Lead: How I Built an Automated Lead Scoring Engine [Python + CRM]

Friday, January 2, 2026

"Stop sending us junk! We called 100 people and 90 of them didn't even know they applied

If you work in Lead Generation, you have heard this scream from the Sales Team. It creates a toxic war between Marketing ("We hit the target!") and Sales ("The leads are trash!").

The problem isn't the lead source. The problem is that **we treat every lead equally.**

A student who downloaded a brochure is not the same as a student who visited the "Tuition Fees" page three times. Instead of forcing sales to call everyone, I built an Automated Lead Scoring Engine using Python and LeadSquared. Here is the blueprint.


1. The Mathematics of Intent

Before writing code, we need a logic model. I classify user actions into three tiers of intent. This is the "Scorecard" I developed for my campaigns:

2. The Architecture: How It Works

Most CRMs have basic scoring. But I wanted something custom. I built a lightweight middleware using Python that sits between my Landing Pages and LeadSquared.

The Scoring Loop

Step 1: User performs action (Web/Email)

Step 2: Webhook sends data to Python Script

Step 3: Script calculates New Score & Updates CRM

3. The Code: Python Scoring Function

Here is a simplified version of the Python logic I use. It doesn't just add points; it creates a "Decay Factor." (A lead who visited last month is less valuable than one who visited today).

lead_score.py Python 3.9
def calculate_score(actions, last_active_days):
  base_score = 0

  # 1. Calculate Action Points
  for action in actions:
    if action == 'visit_pricing': base_score += 50
    elif action == 'open_email': base_score += 10
    elif action == 'download_pdf': base_score += 20

  # 2. Apply Time Decay (The Recency Factor)
  # Score drops by 10% for every week of inactivity
  decay = 1 - (last_active_days / 70)
  final_score = base_score * decay

  return max(final_score, 0)

4. The "Golden Threshold" Handoff

This is where the magic happens. I set up an Automation Rule in LeadSquared.

The Automation Logic:

  • If Score < 30: Do Nothing. Keep sending automated nurture emails. Do not distract sales.
  • If Score 30-70: Warm Lead. Add to "Call Later" list for junior counselors.
  • If Score > 70: HOT LEAD ALERT! Trigger immediate WhatsApp to Senior Sales Manager + SMS Alert.

5. The Business Impact

When we implemented this at Auxin, the volume of leads sent to sales dropped by 40%. Initially, they panicked. But then they looked at their conversion rates.

3x

Conversion Rate Increase

20hrs

Sales Time Saved / Week

Final Thoughts

The job of a Digital Marketer is not just to generate leads; it's to generate Conversations.

By adding a layer of technical intelligence (Scoring) between your ads and your sales team, you stop being a "cost center" and start being a "revenue architect."

Is your Sales Team overwhelmed?

I can help you build this exact Automated Scoring Logic inside your CRM (LeadSquared, HubSpot, or Salesforce) so your team only calls leads who are ready to buy.

About Manas

Digital Marketing Manager & Automation Architect. Connecting data, code, and marketing strategy.