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 Contact us template, and click Start.
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.
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.
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.
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.
Step 4: Add the Form and Script to Your Website
The final step is to place the form on your desired page and then insert the fake lead protection script.
Add the Form to a Page:
Navigate to Content > Landing Pages (or Website Pages) and select the page where your form will be located.
In the page editor, add a Form module to the content area.
Insert the Fake Lead Protection Script:
Go to the page's Settings tab.
Click Advanced in the left menu.
Find the Head HTML section.
Paste the provided fake lead protection JavaScript code into this section.
⚠️ Crucially, ensure you change the unique tracker ID
(tracker-01)within the script to your specific ID.<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>
Setup is now completed! Your HubSpot forms are now integrated with your fake lead protection script, and your workflows will automatically manage fraudulent submissions.













