Duplicate lead even within form session

gerard_reyes Posted by: Gerard Reyes Date Posted: February 17, 2025
Back to Case Studies

Issue

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.

Solution

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);

Achievement

Lead is now captured uniquely and without duplicates.

Snippet/Screenshot/Link

Task: Link
Code: Screenshot