document.addEventListener("DOMContentLoaded", function () { // Find the iframe that contains your GHL form const iframe = document.querySelector("iframe[src*='gohighlevel.com']"); if (!iframe) return;
// Get the 'source' parameter from the current page URL const urlParams = new URLSearchParams(window.location.search); const sourceValue = urlParams.get("source");
// If 'source' exists, append it to the iframe's src URL if (sourceValue) { const iframeSrc = new URL(iframe.src); iframeSrc.searchParams.set("source", sourceValue); iframe.src = iframeSrc.toString(); } });