Normally, a form has a session that last for 10 minutes by default. Submitting the same form as long as within the limit, will update the initial form and not create a new lead.
The issue here is the form creates a new session every refresh without regards to the existing limit. Thus, creating duplicate lead when a form is submitted the second time.
As per Jake’s suggestion, I added a custom script in Google Tag Manager to add a static data-fx-id. This will effectively make the form have an identity besides the session ID.
setTimeout(function() {
document.querySelectorAll('form[action*="/rentcms.activehosted.com/proc.php"]').forEach(function(form) {
form.setAttribute('data-fx-id', '99999999');
console.log('data-fx-id = 99999999 set!');
});
}, 1000);
Lead is now captured uniquely and without duplicates.
Task: Link
Code: Screenshot