Marketo Forms

Our Marketo Forms integration allows you to add validation and address capture to your forms, through a callback function in the embed form code.

Step 1: Modify the embed code to use the built-in callback function

If you haven’t already, get your Marketo forms embed code from the Form Actions drop down on their site.

The default embed form code looks something like this:

				
					<script src="//go.your-domain.co.uk/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_1001"></form>
<script>MktoForms2.loadForm("//go.your-domain.co.uk", "XXX-XXX-XXX", 1001);</script>
				
			

To implement the callback function, this code should be changed like so:

				
					<script src="//go.your-domain.co.uk/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_1001"></form>
<script>MktoForms2.loadForm("//go.your-domain.co.uk", "XXX-XXX-XXX", 1001, function(form){
  // insert Data8 code here
});
</script>
				
			

jQuery is required for our integration to work. If you aren’t sure how to add it to your page, the following will work:

				
					<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
				
			

Step 2: Generate your configuration code using the form below

Simply fill out the form and click generate to get your custom code..

An API key is required to use any of the validation or PredictiveAddress services. You can generate one from the Dashboard, under the Validation tab.

Client API Key
Use PredictiveAddress
Include Multiple Residency Properties (Requires additional licensing)
Include addresses from the UK Multiple Residency database, e.g. multiple flats behind a single letter box, university halls of residence
Include Not Yet Built Properties (Requires additional licensing)
Include addresses from the UK Not Yet Built database, e.g. houses currently being developed
Use Geocoding (Retrieve latitude and longitude information)
Include location information (latitude/longitude, easting/northing and/or grid reference, depending on country) where possible
Use what3words to get Geolocation (Requires additional licensing)
Indicate if the coordinates of the what3words searched for by the user should be included in the response instead of the standard coordinates available for the address. This option consumes a what3words credit in addition to the standard PredictiveAddress credit.
Allowed Countries
An array of ISO2 country codes that the user is allowed to select from, e.g. [ "GB", "US" ] to limit the user to UK and US addresses. Leave this set to null to allow the user to select from all the supported countries
Barred Countries
An array of ISO2 country codes that the user is not allowed to select from, e.g. [ "RU", "CN" ] to allow the user to select any country other than Russia or China. Leave this set to null to not block any countries
Use Email Validation
Email Validation Level
In addition to the Server level checks, validates that the mail server accepts mail for the full email address.
Email Validation Message
Use Phone Validation
Default Country Code
Specify the ISO 2-character country code or international dialling code of the country to validate the telephone number in, unless that number contains an explicit country code prefix. i.e. 'GB' or '44'
Phone Validation Message
Use Bank Validation
Sortcode Field ID
The ID of the sortcode field on your form
Account Number Field ID
The ID of the bank account number field on your form
Bank Validation Message
Use Name Validation
First Name Field ID
The ID of the first name field on your form
Last Name Field ID
The ID of the last name field on your form
Name Validation Message

Step 3: Paste code

Having generated your code above, you can now copy and paste this into your form embed code that we prepared in step 1.

You should insert the code into your callback function, replacing the //insert Data8 code here line with the generated code.

Please note that if you are using the PredictiveAddress service you will need to replace the field id’s (address1address2 etc) with your address field id’s. For help on how to do this, see the ‘Advanced Configuration’ section below.

Join the Conversation

Receive the latest news, views and hot topics directly in your inbox! Sign up below

Follow us on social media