Step 1: Create a Custom Contact Property
First, you'll need a place to store the fraud score passed by the fake lead protection script. This is done by creating a custom property.
Navigate to Settings: From your HubSpot dashboard, click the Settings icon ⚙️ in the top-right corner.
Find Properties: In the left sidebar, scroll down to Data Management and select Properties.
Create the Property: Click the Create property button.
Select Field Type (left side bar): Search for and choose the Number field type. Using the Number field type is essential because the fraud score will be a numerical value.
Finish: Click Create to save your new custom property.
Step 2: Create a Editor Form
Next, you will create a form that includes this hidden property. Using the Legacy Form Editor is necessary for the specific feature of setting a hidden field with a default value, which is crucial for this integration.
Navigate to Forms: Use the search bar on your HubSpot dashboard to find and navigate to Forms (under Marketing or Content & Commerce depending on your settings).
Create a Form: Click the Create form button.
Choose the Form Editor and click Next.
Select a Template: Choose the Start from blank template.
Name the Form: Rename the form to something easily identifiable, for example, Spider AF Form.
Add the Custom Property: In the left sidebar, use the search function to find your newly created property (Spider AF Score). Click it to include it.
Edit the Property Settings:
Click on the Spider AF Score field on the form to open its edit panel.
Set the Default value to 2. This is a critical step. By setting the default to a "safe" or "passing" score (in this example, '2'), any form submission that is not processed by the fake lead protection script will still be created with a non-fraudulent score. This prevents accidental deletion or filtering of legitimate leads if the script fails to run for any reason.
Check the box to Make this field hidden. This ensures the field is present on the form and can receive the fraud score from the protection script, but remains invisible to the person filling out the form.
Click Review and Update.
Publish: Review your form settings and click Update.
Step 3: Create an Automation Workflow
The workflow will automate an action (like deleting or disqualifying a contact) based on the score received in the hidden property. In this example, we'll create a workflow to delete contacts with a fraudulent score (score of 1).
Workflow 1: Deleting Fraudulent Contacts
Navigate to Workflows: Use the search bar to find and navigate to Workflows (usually under Automation or Apps).
Create a New Workflow: Click the Create workflow button and start from scratch.
Workflow Setup:
Set Enrollment Trigger: Click on the trigger and select When filter criteria is met.
Add an Action: Click the plus icon (+) below the trigger to add an action.
Review and Publish: Review your enrollment settings and turn the workflow On.
Workflow 2: Setting Status to Non-Marketing Contact
Instead of deleting a contact, you may choose to keep the record but prevent it from being counted as a marketing contact.
Go back to workflows and repeat Steps 2-4 from Workflow 1: name it (e.g., Spider AF Non-Marketing Status Workflow)
Add an Action: Click the plus icon (+) to add an action.
Review and Publish: Review your settings and turn the workflow On.
Step4: Script Placement on the Website (via GTM)
The last step is to ensure the external lead verification script runs on your website and is able to write the score back to the hidden form field. Using Google Tag Manager (GTM) is recommended for easy management.
1. Creating the Custom HTML Tag
Go to Google Tag Manager: Navigate to your GTM workspace.
Create a New Tag: Click New Tag.
Configure Tag:
Name the Tag (e.g., Legacy Form Own Website).
Choose Custom HTML as the Tag Type.
<script>
var sptrk=function(){var o="https://saf-lv-protect.com/",t="__spd",e=(new Date).getTime();window[t]||(window[t]={init:!1});var c=window[t];c.d||(c.d=[]);var s=c.d;function v(t){var i=document.createElement("script");i.async=!0,i.src=t,document.head.appendChild(i)}c.init||v(o+"u");var u=/^([a-z0-9]{8})-([a-z0-9]{2})$/;return function(){var t=arguments;if(s.push(t),"config"==t[0]&&!c.init&&!c.a){c.init=!0;var i=t[1],n=i.match(u),a=n[1],r=n[2];if(!a||!r)throw"invalid id: "+i;var d=Math.random().toString(36).substring(2,15);v(o+"t/"+a+"?"+("a="+e+"&o="+d))}}}();
sptrk('config', 'tracker-01');
function setSptrkScore(form, score) {
if (form && typeof form.setFieldValue === "function") {
form.setFieldValue('0-1/spider_af_score', String(score));
}
}
sptrk('event', 'form-initialization', null, function(data) {
if (data && typeof data.s === "number") {
var score = data.s;
window.addEventListener('hs-form-event:on-ready', function(event) {
var form = (typeof HubSpotFormsV4 !== "undefined" && HubSpotFormsV4.getFormFromEvent)
? HubSpotFormsV4.getFormFromEvent(event)
: null;
setSptrkScore(form, score);
});
if (HubSpotFormsV4) {
HubSpotFormsV4.getForms().forEach(function(form) {
setSptrkScore(form, score);
});
}
}
});
</script>
2. Setting the Trigger
The trigger ensures the anti-fraud script only executes when your form is visible.
Configure Trigger: Click in the "Triggering" section.
Create New Trigger: Click the plus icon (+) in the top-right.
Trigger Type: Choose Page View.
Set Condition: Select "Some Page Views."
Define Filter: Set the condition to "Page URL contains [The unique URL or identifier of the page where the form is embedded]."
Name and Save the trigger.
Save the Tag.
Click Submit in the main GTM workspace to publish all your changes.
Setup is complete! Your external website form is now protected by an anti-fraud script that feeds data to HubSpot, allowing your workflow to automatically clean out fake leads.













