AI Sales

How to keep HubSpot leads list updated & without duplicates

Lucas Perret
LAST UPDATED
June 9, 2024
READING TIME
7 min.

One of the key factors to a successful campaign is reaching out to the right people.

But how do you ensure you don't import and contact the same prospects multiple times and ruin your chances of getting replies?

In this article, you'll find a hack to quickly check the status of your leads in HubSpot before import, so you don't lose time over prospecting.

Step #1 Ensure your leads' status is up to date

The first step to keeping your leads list clean is ensuring that the "lead status" property in HubSpot reflects your prospects' lifecycle.

E.g., when a deal is won, your lead status should be "Customer", or when your lead has been contacted, their status should be "Contacted".

Here's how you can automate lead status movements:

  1. Go to HubSpot's workflow automation
  2. Create a new workflow for each status
    → for "Customer", use this workflow:

If you want to save hours manually migrating leads data between your CRM and sales engagement tool, you can integrate your HubSpot CRM into lemlist.

This integration will allow lemlist to enrich your HubSpot database with accurate leads info, so you'll have their 100% synced overview.

Depending on your setup, you can add and update leads in HubSpot due to their activity in the lemlist campaign (such as Replied, Clicked, Marked as interested, etc.)

Following this guide, you can set up your lemlist x HubSpot integration to always know your leads' status and how to approach them for the best results!

Step #2 Check HubSpot status via Google Sheets

Once you have a Google sheets list of freshly scraped leads, here's what you should do before their import to HubSpot or lemlist:

  1. Go to Extensions → Apps Script

2. Remove the code and copy-paste the following instead
 → copy and paste this code:

HUBSPOT_API_KEY = "YOUR_API_KEY"

/**
* Check if the contact is in Hubspot.
*
* @param {string} email.
* @return HS_lead_Status
* @customfunction
*/

function findHubspotContact(email){  

result = hubspotLookUp(email)  

while (result.includes("RATE_LIMITS")){

    var randomNumber = Math.random();

  // convert 5 seconds to milliseconds
  var maxSleep = 1000;

  // multiply the random number by the max sleep time
 var sleepTime = randomNumber * maxSleep;

 // use the Utilities.sleep() method to make the script wait
  Utilities.sleep(sleepTime);

   result = hubspotLookUp(email)  }    return result    }function hubspotLookUp(email) {
 var apiKey = HUBSPOT_API_KEY;
 var url = "<https://api.hubapi.com/crm/v3/objects/contacts/search>";

 var options = {
   "muteHttpExceptions": true,
   "method": "post",
   "headers": {
     "Authorization": "Bearer " +apiKey,
     "Content-Type": "application/json",
     "Accept": "application/json"
   },
   "payload": JSON.stringify({
   "properties": [ "email", "hs_lead_status","notes_last_contacted" ],
   "filterGroups":[
     {
       "filters":[
         {
           "propertyName": "email",
           "operator": "EQ",
           "value": email
         }
       ]
     }
   ]
   })
 };

 var response = UrlFetchApp.fetch(url,options);
 var responseCode = response.getResponseCode();
 var responseBody = response.getContentText();

// Logger.log(responseBody)
if (responseCode === 200) {
if (JSON.parse(responseBody).results[0]){

  // display the results in 2 columns
var results = new Array(1);let info = new Array(3);
info[0]=JSON.parse(responseBody).results[0].properties.hs_lead_status
if (JSON.parse(responseBody).results[0].properties.notes_last_contacted){
let lastContactedDate= Date.parse(JSON.parse(responseBody).results[0].properties.notes_last_contacted)
info[1]= new Date(lastContactedDate)}
results[0]=info

return results} else {return "Not in Hubspot"}
 } else {
   Logger.log(Utilities.formatString("Request failed forgot %d: %s", responseCode, responseBody));
   return Utilities.formatString("Request failed forgot %d: %s", responseCode, responseBody);
 }
}

3. Get your HubSpot API Key:

  • Go to HubSpot's Settings → Integrations → Private Apps
  • Click on Create a Private App
Untitled
  • Give a name and go to Scopes
  • Authorize read access to "crm.objects.contacts "
  • Click on Create app
  • Choose Show token and copy it

4. Paste your HubSpot API key into the Google Apps Script project
 → your setup should look like this:

5. Save your project and go back to your sheet

6. Use formula =findHubspotContact({email}) to see your new leads' exact status in HubSpot CRM

Step #3 Remove low quality contacts

You could have contacts that do nothing but damage your sender reputation

Any contacts based on guessed email addresses or from bought email lists are affecting your open rates. Reaching out to these contacts may be a direct violation or privacy laws within your region. Also, chances these contacts will engage with your emails are pretty slim. This tells your email service provider that you're sending spam, which may lead to your account being blacklisted. 

You can ensure you're contacting the correct email addresses with lemlist's free email checker

Step #4 Remove contacts that never opened your emails

Guessed email addresses aren't the only ones damaging your sender reputation.
Even valid email addresses can decrease your open rates if they never engage with your emails. Here's how you can list all contacts that didn't open any of your sent emails:
1. Select CRM > Lists from left-hand menu.

check hubspot email lists

2. Click on Create list in the upper right corner.

create new list in hubspot


3. Name your list and add a description.
4. Select Add filter.
5. From Filters, click Contact properties, and select Last marketing email open date.

set a new filter for hubspot lists

6. To edit the filter, open the drop-down menu below Last marketing email open date and select is unknown.

customize email list filters on hubspot

7. Below the created filter, select Add filter.

add more filters to hubspot list

8. Set Filtering on to Activity (Associated Object).
9. Set the filter category to Number of email clicks.

filter hubspot lists by number of email clicks

10. To avoid removing contacts that you just added to your HubSpot lists, select is less than, and set a relevant limit.

filter hubspot lists by number of opened emails

11. Click Save in the top-right corner.

Conclusion

Keeping your leads list clean saves you hours creating campaigns for existing customers or those not ready to buy from you.

Use this Google Sheet hack and lemlist to keep in the loop with your prospects' lifecycle so you approach them at the right time and boost your sales chances!

If you want to grow your business with more advice like this, join the lemlist family, where 11k+ successful people share free outreach tips daily. 🚀

Get weekly outreach tips
SHARE THIS ARTICLE
Thanks! You've successfully subscribed to lemlist newsletter
Oops! Something went wrong while submitting the form.
G2 Rating
Price
Best for
Standout feature
Con
4.9
star
star
star
star
star
$30/mo
$75/mo
$2,999/mo
Large, distributed sales teams
AI evaluation precision, gamified KPIs
Lack of tracking system
4.6
star
star
star
star
star-half
Not publicly available
Sales operations and finance teams
Powerful configurability
Limited training resources and complex to navigate
4.4
star
star
star
star
star-half
Not publicly available
Mid-market and enterprise businesses
Comprehensive incentive management
Potentially high cost and steep learning curve
4.7
star
star
star
star
star-half
$15/user/mo
$40/user/mo
Enterprise: custom price
Complex sales structures and businesses of all sizes
Complex sales structures and businesses of all sizes
Steep learning curve
4.6
star
star
star
star
star-half
Not publicly available
Collaborative teams
Connected planning
Complexity and steep learning curve
4.6
star
star
star
star
star-half
Not publicly available
Companies with complex sales structures
Complex incentive compensation management (ICM) with high efficiency and accuracy
Complexity for smaller teams and potentially high costs
4.7
star
star
star
star
star-half
Not publicly available
Companies who want to automate commission calculations and payouts
Simplicity and ease of use
Lack of features like redirection
4.7
star
star
star
star
star-half
$30/user/mo
$35/user/mo
Custom: upon request
Businesses that need a comprehensive and user-friendly sales compensation management software
Ease of use and adoption
Lack of ability to configure the product based on user needs
4.8
star
star
star
star
star-half
Not publicly available
Companies with modern sales culture and businesses who want real-time insights
A built-in dispute management and real-time visibility
Users say it works slowly, customer support is slow
4.9
star
star
star
star
star
$30/user/mo
$50/user/mo
Smaller sales teams
Powerful automation
Lesser user base and average user interface
4.7
star
star
star
star
star-half
Not publicly available
Companies with scalable needs
Automated Commission Calculations
Lack of filtering by date, no mobile app
ERP vs. CRM
ERP
CRM
Summary
Backbone of a business's internal operations.
Backbone of customer-centric interactions and operations.
Goal
To centralize and streamline core business processes in a company.
To increase customer experience, satisfaction and loyalty, and boost sales.
Focus
Internal operations and processes across departments (finance, accounting, inventory, supply chain, HR, and sales).
All interactions with leads and customers.
Manages
Internal business data like financial data, inventory levels, production details, supply chain, HR info.
All customer data like contact info, purchase history, communication history, customer preferences and more.
Users
Finance, accounting, operations, supply chain, and HR departments.
Customer-facing teams like sales, marketing, and customer service.
Benefits
Streamlines operations, improves data accuracy, enhances decision-making, boosts collaboration, increases productivity.
Improves customer relationships, increases sales, strengthens customer service, personalizes marketing campaigns, provides insights.
Price
$150 per user per year on average.
$10 to $30 per user per month on average.
PRM Tool
Rating
Feature
Pro
Con
Mobile App
Integrations
Free Plan
Pricing
4.65
star
star
star
star
star-half
Org-wide alignment
User-friendly layout and database
Suboptimal as a personal CRM
square-check
Lack of tracking system
square-check
Team: $20/month
Business: $45/month
4.7
star
star
star
star
star-half
Social Media Integration
Easy contact data collection
No marketing/sales features
square-check
Lack of tracking system
square-xmark
7-day trial
$12/month
4.75
star
star
star
star
star-half
Block Functions
High customization capability
Not a dedicated CRM
square-check
Limited
square-check
Plus: €7.50/month
Business: €14/month
N/A
Open-source
Open-source flexibility
Requires extensive manual input
square-xmark
Limited
square-check
Self-hosted
$9/month or
$90/year
3.1
star
star
star
Simple iOS app
Ideal for non-tech-savvy users
iPhone only
square-check
iOS only
Limited
square-xmark
1-month trial
$1.49/month or
$14.99/month
3.6
star
star
star
star-half
Smart Contact Management
Feature-rich and flexible
Reported bugs
square-check
Rich
square-xmark
7-day trial
Premium: $13.99/month
Teams: $17.99/month
4.4
star
star
star
star
star-half
Customizable Interface
Customizable for teamwork
Pricey for personal use
square-check
Rich
square-xmark
Standard: $24/member
Premium: $39/member
4.7
star
star
star
star
star-half
Integrated Calling
Integrated Calling
Too sales-oriented & pricey
square-check
Rich
square-xmark
14-day trial
Startup: $59/user/month
Professional: $329/user/month
4.8
star
star
star
star
star
Business Card Scanning
Business Card Scanning
Mobile only
square-check
Limited
square-check
$9.99/month
4.45
star
star
star
star
star-half
160+ app integrations
Comprehensive integrations
No free app version
square-check
Rich
square-xmark
14-day trial
$29.90/month or
$24.90/month (billed annually)
Capterra Rating
Free Trial
Free Plan
Starting Price (excluding the free plan)
Maximum Price (for the most expensive plan)
Best for
4.5
star
star
star
star
star-half
square-check
14-day
square-check
€15/month/seat billed annually
€792/month/3 seats billed annually + €45/month for each extra seat
Versatility and free plan
4.2
star
star
star
star
square-check
30-day
square-xmark
But it offers reduced price to authorised nonprofit organisations
€25/user/month
€500/user/month billed annually (includes Einstein AI)
Best overall operational CRM
4.3
star
star
star
star
star-half
square-xmark
square-check
Limited to 3 users
Comprehensive incentive management
€52/user/month billed annually
Small-medium businesses and automation
4.5
star
star
star
star
star-half
square-check
14-day
square-xmark
€14/seat/month billed annually
€99/seat/month billed annually
Sales teams and ease of use
4.1
star
star
star
star
square-xmark
square-check
Limited 10 users
$9.99/user/month billed annually
$64.99/user/month billed annually
Free plan for very small teams up to 10
CRM goal
Increase the sales conversion rate for qualified leads from marketing automation campaigns by 10% in the next 6 months.
SMART Breakdown
1. Specific: It targets a specific area (conversion rate) for a defined segment (qualified leads from marketing automation).
2. Measurable: The desired increase (10%) is a clear metric, and the timeframe (6 months) allows for progress tracking.
3. Achievable: A 10% increase is possible based on historical data and potential improvements.
4. Relevant: Boosting sales from marketing efforts aligns with overall business objectives.
5. Time-bound: The 6-month timeframe creates urgency and a clear target date.
Actions
Step 1: Refine lead qualification criteria to ensure high-quality leads are nurtured through marketing automation.
Step 2: Personalize marketing automation campaigns based on lead demographics, interests, and behavior.
Step 3: Develop targeted landing pages with clear calls to action for qualified leads.
Step 4: Implement lead scoring to prioritize high-potential leads for sales follow-up.
Step 5: Track and analyze campaign performance to identify areas for optimization.
Outcomes
Increased sales and revenue
Improved marketing automation ROI
Marketing and sales alignment
Data-driven marketing optimization
Table
CDP Software
CRM Software
Approach
Data-centric
Customer-centric
Focus
Interactions across various channels and touchpoints, both online and offline.
Sales, marketing, and customer service interactions.
Functionality
Automatically collects, organizes, tags, and makes data available in real-time.
Helps businesses track customer interactions, sales pipelines, prospects, and service requests.
Goals
Personalized customer experiences across all channels.
Better customer relationships, streamlined processes, and improved profitability.
Benefits
Data integration, management, and accessibility, allowing for detailed analysis and segmentation.
Better communication within teams and with customers by organizing information about customer interactions and history.
Data Handling
Handles both identified and anonymous data, stitches together various data points.
Deals primarily with identified customer data.
Use Cases
Personalized marketing campaigns, targeted advertising, content customization across multiple channels.
Managing campaigns and leads, enhancing customer service, providing better customer support, increasing customer satisfaction and loyalty.
Examples
Insider, Bloomreach, Salesforce Marketing Cloud CDP
HubSpot, Salesforce Sales Cloud Lightning Professional, and Zoho CRM

What you should look at next

Receive weekly outreach tips in your inbox, sent to 210 000+ salespeople, marketers, founders, and entrepreneurs worldwide!

Subscribe to the lemlist newsletter
You've successfully subscribed to the lemlist newsletter!
Oops! Something went wrong while submitting the form.