top of page
bottom of page
window.addEventListener('message', function(event) { // JotForm sends a 'submission-completed' message automatically if (event.data.action === 'submission-completed' || event.data === 'sent') { // Match the ID to the specific form the client mentioned var formID = event.data.formID || "Check Form ID"; window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "jot_form_submit", form_name: (formID === "253146057933055") ? "gapcoverage_form" : "contact_us_form", form_id: formID, page_location: window.location.href }); console.log("Success! DataLayer pushed for Form ID: " + formID); } }, false);