Marketo Forms
If you're using Marketo forms to record customer sign-ups in PartnerStack (for example, if your "get a demo" or "contact us" form is powered by Marketo), you'll want to combine PartnerStackJS with the Marketo Forms JavaScript API. Please refer to their documentation for the most up-to-date information on accessing data from forms.
PartnerStackJS (Step 1) is required
Before continuing, please ensure that Step 1 of the snippet setup has been completed correctly. Customizing this example to fit your needs helps with Step 2 of the snippet setup only.
If you want to send customer data into PartnerStack on form submit, a great way to do that could be through the onSubmit
handler provided in the Forms API:
// Please update values appropriately.
// See: https://developers.marketo.com/javascript-api/forms/api-reference/
MktoForms2.loadForm("//your-base-url.marketo.com", "your_munchkin_id", 12, function(form) {
// Add an onSubmit handler
form.onSubmit(function(){
// Get the form field values
var vals = form.vals();
// Set customer data object in PartnerStackJS:
growsumo.data.name = vals.Name;
growsumo.data.email = vals.Email;
// In this case, email is the customer identifier for my business
growsumo.data.customer_key = vals.Email;
// Send data to PartnerStack:
growsumo.createSignup();
});
});
The original example can be found in Marketo's developer documentation. Please customize these to fit your program needs. For example:
- You may wish to use the
onSuccess
handler instead. The example here usesonSubmit
as the triggering event to send information to PartnerStack - Here we're using
Name
andEmail
, but you may want to use different fields from your Marketo form to populate the information in PartnerStack.
Updated 12 months ago