Below you'll find the steps to embed a custom Pardot form:
Add a new step and choose the "Lead Form" guide.
Click on the "Embed Custom Form" button underneath the Storylane Lead Form.
Choose "Custom" from the dropdown and copy-paste the code from Pardot.
Above the code you pasted from Pardot, you'll need to add the following code:
<script>
window.addEventListener("message", function (event) {
if (event.data && event.data.message === "PARDOT_FORM_SUCCESS") {
window.parent.postMessage({
message: 'storylane-lead-submit',
payload: {
lead: { email: event.data.email }
}
},'*');
};
});
</script>
In Pardot, under the "Thank you Code" tab from the "Completion Actions" section, you'll need to add the following code:
<script>
window.parent.postMessage(
{
message: "PARDOT_FORM_SUCCESS",
email: "{{Recipient.Email}}"
},
"*"
);
</script>
You are now ready to test the Pardot form you embeded. Feel free to contact support@storylane.io if you have any questions or need help with embedding a custom Pardot form.