Use subdomain for identity to capture leads

gerard_reyes Posted by: Gerard Reyes Date Posted: October 21, 2025
Back to Case Studies

Issue

This client has multiple forms in different subdomain that shares the same generic characteristics. We need to map every form based on site but they have no unique identifier in the form to be used.

Solution

Used the subdomain URL to give the form a unique class.

var url = window.location.href;
var domainPart = url.split('.greenlanternpizza.com')[0];
var xxx = domainPart.split('//')[1] || 'default';
var className = 'rcfx-custom-class-' + xxx;
my_form.classList.add(className);

Achievement

Leads are properly captured with the correct mapped form.

Snippet/Screenshot/Link

Task: Link

Code: Screenshot