Lead Mapping (Hubspot iFrame – without GTM access)

Posted by: JP Betis Date Posted: December 29, 2023
Back to Case Studies

Issue

MCFX script doesn’t seem to capture all the lead data being sent by Hubspot forms

Solution

I found a Guru card which talks about the unconventional / workarounds that we can use to map lead forms from all known iFrames such as Hubspot : https://app.getguru.com/card/cKMnndRi/DEV-LeadmanagerFX-Guides

It’s aim is to insert the ‘capture’ script inside the onFormSubmit which is typically found on Hubspot shared form code. 

You may update their Hubspot shared form code and add these two set of codes

onFormReady: function($form){},
mcfx('capture', $form.get(0));

It should look like this

hbspt.forms.create({
portalId: "20170311",
formId: "6f988f47-db92-415b-a4f4-0332c08dbbf9",
onFormReady: function($form){
},
onFormSubmit: function($form) {
mcfx('capture', $form.get(0));
}
});

Note: This tip is a last resort option, especially if the client wants to avoid sharing any access on their GTM container for us to create custom tags or fake forms.

Achievement

I was able to re-map all lead forms that were previously unable to pull in lead data

Snippet/Screenshot/Link