Score HubSpot leads based on firmographic and technographic fit using Zapier
Prerequisites
- Zapier account (Professional plan required for Code by Zapier)
- HubSpot account connected to Zapier via OAuth
- A custom HubSpot contact property for the fit score (e.g.,
icp_fit_score, number type, 0-100)
Why Zapier?
Zapier is the fastest option to set up if you already have a Zapier account. The HubSpot trigger fires on new contacts, and Code by Zapier lets you write the scoring formula in JavaScript or Python. The main trade-off is cost — Zapier's Professional plan ($20-50/mo) is required for the Code step, which is more expensive than self-hosted n8n for the same functionality.
How it works
- HubSpot trigger fires when a new contact is created
- Code by Zapier applies the weighted scoring model and outputs a 0-100 score
- HubSpot action updates the
icp_fit_scoreproperty on the contact
Step 1: Set up the HubSpot trigger
Create a new Zap. Choose HubSpot as the trigger:
- Trigger event: New Contact
- Additional Properties to Retrieve:
jobtitle,company,numberofemployees,industry,hs_analytics_source
HubSpot's Zapier trigger returns very few fields by default. If you skip "Additional Properties to Retrieve," your scoring logic will operate on empty data and every contact will score 0.
If you want to re-score when enrichment data changes, use "Updated Contact Property" as the trigger and set it to fire when numberofemployees or industry changes. You'll need a separate Zap per property.
Step 2: Add Code by Zapier for scoring
Add a Code by Zapier step:
- Language: JavaScript
- Input Data:
employees->{{numberofemployees}}industry->{{industry}}jobtitle->{{jobtitle}}source->{{hs_analytics_source}}
let score = 0;
// Company size scoring (0-30 points)
const emp = parseInt(inputData.employees || '0');
if (emp >= 200 && emp <= 2000) score += 30;
else if (emp >= 50 && emp < 200) score += 20;
else if (emp >= 2000 && emp <= 10000) score += 15;
else if (emp > 0) score += 5;
// Industry scoring (0-25 points)
const industry = (inputData.industry || '').toLowerCase();
const ideal = ['saas', 'technology', 'software', 'computer software'];
const good = ['financial services', 'consulting', 'marketing'];
if (ideal.includes(industry)) score += 25;
else if (good.includes(industry)) score += 15;
else if (industry) score += 5;
// Seniority scoring (0-30 points)
const title = (inputData.jobtitle || '').toLowerCase();
if (['ceo','cto','cfo','coo','cmo','cro','chief'].some(t => title.includes(t))) score += 30;
else if (['vp','vice president','head of'].some(t => title.includes(t))) score += 25;
else if (['director'].some(t => title.includes(t))) score += 20;
else if (['manager','lead'].some(t => title.includes(t))) score += 10;
// Source scoring (0-15 points)
const sourceMap = {
'ORGANIC_SEARCH': 15, 'DIRECT_TRAFFIC': 12, 'REFERRALS': 10,
'PAID_SEARCH': 8, 'SOCIAL_MEDIA': 5, 'EMAIL_MARKETING': 5
};
score += sourceMap[inputData.source] || 0;
output = [{ score: Math.min(score, 100) }];Step 3: Update the HubSpot contact
Add a HubSpot action:
- Action event: Update Contact
- Contact: Use the contact ID from the trigger step
- icp_fit_score:
{{score}}(from the Code step)
Step 4: Add a filter for high scores (optional)
To notify your team about high-fit leads, add a Filter step before a Slack action:
- Condition: Score from Code step → Greater than → 70
Then add a Slack action to post to your channel.
Step 5: Test and publish
- Click Test on each step to verify the score calculation
- Check HubSpot to confirm the
icp_fit_scoreproperty was updated - Turn the Zap On
Limitations
- Code by Zapier requires the Professional plan ($29.99/mo) or higher.
- No batch scoring: Zapier processes contacts one at a time. To re-score your entire database, trigger bulk updates from HubSpot or use the Code + Cron approach.
- Polling delay: 1-15 minutes depending on your plan.
Troubleshooting
Common questions
Can I use Zapier's built-in Formatter instead of Code by Zapier?
For simple scoring (e.g., if industry = X then 25 points), yes. But the Formatter step gets unwieldy with 4+ scoring dimensions. Code by Zapier gives you a single step with full logic control. It requires the Professional plan ($29.99/mo).
How many contacts can I score per month on each plan?
Each scored contact uses 1 Zap execution (multi-step). The Professional plan includes 750 tasks/mo — roughly 250 scored contacts (3 steps each). The Team plan gives 2,000 tasks/mo for higher volume.
Cost
- Professional plan: $29.99/mo. Each scored contact = 2 tasks (trigger + code + update = 1 Zap execution counted as tasks per step).
- Team plan: $69.99/mo if you need multi-step Zaps with Slack notifications.
Looking to scale your AI operations?
We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.