Introduction
During the trial, you can visualize fraudulent leads (conversions) such as spam or bots and check how frequently they are occurring.
Trial Setup
To use the Spider FLP trial, you need to install the Spider AF tag (JavaScript).
There are 3 locations where the Spider AF tags must be installed:
All Pages
Form input/submit pages
Thank You Page
The <tracker>-01
part in each tag is a string unique to your account. Please check with your Spider representative to get the correct value.
Also, if you are using forms via Webflow, HubSpot Form Editor, or HubSpot Legacy Forms, the tag will be different. Please contact us for instructions in those cases as well.
If anything is unclear, we’ll be happy to assist—feel free to reach out 🙇♀️
1. Tag for All Pages
Placement: All pages
⚠️ If you have already integrated the Spider AF tag across all pages, you do not need to install it again.
<script>
var sptrk=function(){var o="https://sp-trk.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', {
// optional parameters:
// segment: '##segment##'
});
</script>
2. Tag for Form Input/Submission Page
Placement: Form input or submission pages
Please dynamically replace ##mail##
, ##name##
, and ##tel##
with the actual field values (e.g., name, email, phone number).
If it is difficult to do so due to personal data protection policies, you can leave them as-is. However, if you allow email address detection, it will help identify conversions using disposable email addresses.
<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];cd||(cd=[]);var s=cd;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&&!ca){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', 'XXXXXXX-01');
var timeoutMs = 1500;
function addTimeoutFailsafe(form) {
return setTimeout(function(){
form.click();
}, timeoutMs);
}
function getFormValues(form, targetKeys) {
var obj = {};
Object.keys(targetKeys).forEach(function(k) {
var element = form.elements[targetKeys[k]];
obj[k] = element ? element.value : null;
});
return obj;
}
function closestForm(element) {
while (element && element.tagName !== "FORM") {
element = element.parentElement;
}
return element;
}
function saveSubmissionData(eventName, formValues) {
var now = new Date().getTime();
var timeKey = '__sptrk_submit_' + eventName + '_t';
var valueKey = '__sptrk_submit_' + eventName + '_v';
sessionStorage.setItem(timeKey, now);
sessionStorage.setItem(valueKey, JSON.stringify(formValues));
}
var hasExecutedFormSubmission = [];
function processForm(e, targetKeys) {
var form = closestForm(e.target);
if (hasExecutedFormSubmission[form]) {
hasExecutedFormSubmission[form] = false;
return true;
}
var formValues = getFormValues(form, targetKeys);
saveSubmissionData("submission", formValues)
if (typeof sptrk === "function") {
if (e.preventDefault) { e.preventDefault(); }
hasExecutedFormSubmission[form] = true;
var timeoutId = addTimeoutFailsafe(e.target);
sptrk("validate", "submission", formValues, function(result) {
clearTimeout(timeoutId);
e.target.click();
});
}
}
function addEventListenerToForm() {
document.querySelectorAll("form input[type=submit]").forEach(function(element) {
element.addEventListener("click", function(event) {
processForm(event, {
email: "##mail##",
name: "##name##",
phone: "##tel##"
});
});
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", addEventListenerToForm);
} else {
addEventListenerToForm()
}
</script>
3. Tag for Thank You Page
Placement: Thank You Page
⚠️ Please configure the part labeled **IDs issued separately by CV (such as application numbers)**
so that the corresponding ID (e.g., application number) is dynamically inserted.
<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', 'XXXXXXX-01', {xsid: '**IDs issued separately by CV (such as application numbers)**'});
var targetSubmissionName = "submission";
var now = new Date().getTime();
var timeKey = '__sptrk_submit_' + targetSubmissionName + '_t';
var valueKey = '__sptrk_submit_' + targetSubmissionName + '_v';
var eventValueRaw = sessionStorage.getItem(valueKey);
var submitTime = sessionStorage.getItem(timeKey);
// 1 minute in millisec
var timeLimit = 60 * 1000;
if (submitTime && now - submitTime < timeLimit) {
var eventValues = {};
try {
eventValues = eventValueRaw ? JSON.parse(eventValueRaw) : {};
} catch (e) {
eventValues = {"submit_value": eventValueRaw};
}
sptrk("event", "conversion", eventValues);
}
sessionStorage.removeItem(timeKey);
sessionStorage.removeItem(valueKey);
</script>
[Supplementary information]
When dynamically inserting the corresponding ID (e.g., application number), we recommend using “User-Defined Variables” in Google Tag Manager (GTM).
Follow these steps:
Open GTM
Select “Variables” from the left menu
In the “User-Defined Variables” section, confirm the variable name you want to use
Example:
User-defined variable name: LP Form Inquiry Number
Then, replace the value of xsid
in the Spider thank-you page tag with this variable.
Example:
If the user-defined variable name is LP Form Inquiry Number
, the tag should be written as:
sptrk('config', '<tracker>-01', { xsid: '{{LP Form Inquiry Number}}' });