Score HubSpot leads based on firmographic and technographic fit using Zapier
medium complexityCost: $20-50/mo
Prerequisites
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)
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
Always add properties to retrieve
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.
Trigger on updates too
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.
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.
Need help implementing this?
We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.