Implement Identify calls with Marketo forms

Working with Marketo forms? You can take advantage of the form embed code to make your identify call to Clearbit X without having to rely on a developer.

 

As a reminder, an identify call allows you to get a clear picture of the person behind the anonymous IP address visiting your website.

 

Let's start with a simple Marketo form that include's a First NameLast Name, and Email field. It should look like this:

marketo-identifycall-1.png

 

Once you approve your form, click on Embed Code from the Form Actions menu and copy the code.

marketo-identifycall-2.png

 

A standard Marketo form embed code looks like this:

<script src="YOUR-SCRIPT-URL-HERE"></script>
<form id="YOUR-FORM-ID-HERE"></form>
<script>MktoForms2.loadForm("YOUR-BASE-URL-HERE", "YOUR-MUNCHKIN-ID-HERE", YOUR-FORM-ID-HERE);</script>

 

We'll use Marketo's onSubmit form callback from their API Reference to modify this code and do the following:

  • Fetch all form values
  • Grab the email field's value (i.e. the email submitted by the person viewing your website)
  • Send the identified person to Clearbit
function (form) {
form.onSubmit(function () {
// Fetch all form values
let formValues = form.getValues();
// Grab the email field's value
let submittedEmail = formValues.Email;
// Send the identified user to Clearbit
clearbit.identify(submittedEmail, {
email: submittedEmail,
});
});
}

 

The new embed code should look like this:

<script src="YOUR-SCRIPT-URL-HERE"></script>
<form id="YOUR-FORM-ID-HERE"></form>
<script>
MktoForms2.loadForm("YOUR-BASE-URL-HERE", "YOUR-MUNCHKIN-ID-HERE", YOUR-FORM-ID-HERE,
function (form) {
form.onSubmit(function () {
// Fetch all form values
let formValues = form.getValues();
// Grab the email field's value
let submittedEmail = formValues.Email;
// Send the identified user to Clearbit
clearbit.identify(submittedEmail, {
email: submittedEmail,
});
});
}
);
</script>

 

Now, when your website visitors submit your Marketo forms, you'll be able to identify what pages they have been visiting through Clearbit X.