Skip to the content

Marketo Integration

Our integration for Marketo supports the following features:

  • PredictiveAddress
  • International Telephone Validation
  • Email Validation
  • BankAccountValidation

** can be extended to support any of our API's found here

Installation

To integrate Data8 address capture and validation into your Marketo landing page or forms, add the Javascript code from the relevant section below to your landing page or form integration. Remember to change 'Your-Api-Key-Here' to your own Data8 API key from the Data8 Dashboard.

Should you ever wish to remove the Data8 Marketo integration, simply remove the code from your Marketo landing page or form.

Landing Page Integration

Our Marketo landing page integration allows you to add validation and address capture to your forms, by customising the landing page template. This integration adds settings to the landing page which can be configured in the variables section of the sidebar.

Copy and paste the code below into your landing page template. Then see the section below on configuring these options to suit your needs.

Validation

PredictiveAddress

Configuration

Once you have implemented either or both of the code snippets above into your landing page template, you should be able to see the custom Data8 variables into the variables section of the sidebar on the landing page that the template is applied to. These variables control which services are used, the level of validation to apply, and the error messages you wish to display.

Custom Variables

Enter your client-side API key into the D8 API key variable box. To create a client-side API key, create a new API key and add the domain of your marketo landing page to the list of 'Allowed Domains'.

Enable the services of your choice with the toggles at the bottom of the variables section (must have credits on your account for the services you enable).

Enter any other appropriate configuration options such as D8 Email Level, D8 Phone Default Country, or add bank account details or address field id's into the respective variables. These id's can be found by previewing the landing page, right clicking on the field in the form and click 'Inspect'. The field should have an id attribute based on the field name like 'BillingStreet' for example.

You can find the full list of values for the email level option in the 'Advanced Configuration Options' section below. Descriptions for the phone validation options can also be found in the 'Advanced Configuration Options' section below.

Marketo Forms Integration

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

The code below should be integrated into your embed form code by using the built in callback function. Then see the section below on configuring these options to suit your needs.

The default embed form code looks something like this:

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

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

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

Now we are ready to copy/paste the relevant code below into your callback function to apply Data8 address capture and validation to your form. Replace the // Insert Data8 code here line with either/both of the below.

Validation

PredictiveAddress

If you are using PredictiveAddress, you will also need to include the below PredictiveAddress libraries before the embed code.

<script type="text/javascript" src="https://webservices.data-8.co.uk/javascript/predictiveaddress.js"></script>
<link rel="stylesheet" href="https://webservices.data-8.co.uk/content/predictiveaddress.css" />

You can then paste the code below into the embed code callback function.

Configuration

Once you have implemented either or both of the code snippets above into your embed code, you can now edit the Data8 variables found at the top of the validation code or within in the PredictiveAddress code. These variables control which services are used, the level of validation to apply, and the error messages you wish to display. For bank account validation and PredictiveAddress, you must specify field id's to tell our code which fields to attach to. These id's can be found by previewing the form, right clicking on the field in the form and clicking 'Inspect'. The field should have an id attribute based on the field name like 'BillingStreet' for example.

The validation settings code looks like this:

var d8Validation = {
  apiKey: "your-api-key-here",
  email: {
      enabled: false,
      level: "Address",
      msg: "Email address is invalid"
  },
  phone: {
      enabled: false,
      useLineValidation: false,
      useMobileValidation: false,
      defaultCountryCode: 44,
      msg: "Phone number is invalid"
  },
  bank: {
      enabled: false,
      sortcodeId: "",
      accountNumId: "",
      msg: "Bank details are invalid"
  }
};

Enter your client-side API key into the apiKey variable. To create a client-side API key, create a new API key and add the domain of the page(s) your Marketo form will be added to, to the list of 'Allowed Domains'.

Enable the services of your choice with boolean values, true or false (must have credits on your account for the services you enable).

You can find the full list of values for the email level option in the 'Advanced Configuration Options' section below. Descriptions for the phone validation options can also be found in the 'Advanced Configuration Options' section below.

Advanced Configuration Options

After implementing the code and configuring the options to suit your needs, the relevant address capture and/or validation will be applied to the appropriate fields on your data-capture forms.

Telephone Validation

When Telephone Validation is enabled, all suitable telephone number fields are validated automatically (input fields of type 'tel'). There are also four other options available to you for further control of validation: Landline Validation, Mobile Validation, Default Country Code, and the custom error message to display. If entered data is identified as invalid, the error will be highlighted suitably on the form.

Option Description
Landline Validation If you have purchased our UK Landline Validation service, enable this option to use the enhanced level of validation for any UK landline numbers in addition to the standard level of validation provided by the International Telephone Validation service.
Mobile Validation If you have purchased our Mobile Validation service, enable this option to use the enhanced level of validation for any mobile numbers in addition to the standard level of validation provided by the International Telephone Validation service.
Default Country Code 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.

Email Validation

When Email Validation is enabled, all suitable email address fields (input fields of type 'email') are validated automatically. The level of validation to apply to entered email addresses, along with the custom error message to display, can be configured in the settings. See the table below for information on each level. If entered data is identified as invalid, the error will be highlighted suitably on the form.

Email Validation Levels:

Level Description
Syntax The supplied email is checked to ensure that it meets the standard email address format. This is the quickest option and would reject such incorrect email addresses as "noone@nowhere" and "N/A", but would accept incorrect email addresses that are correctly formed but that do not include a valid domain name such as "noone@data-9.com".
Domain The supplied email is checked to ensure that the domain name (the part to the right of the @ sign) exists and is set up to receive email. This is still normally very quick, but can take a few seconds in some cases. This check would reject incorrectly formatted email addresses in the same way as the Syntax check, and would also reject a misspelled domain name such as "noone@data-9.com". It can also detect when a domain name exists but does not handle email, such as "noone@example.com". It does not verify that the part of the email address to the left of the @ sign exists.
Server In addition to the Domain level checks, validates that at least one of the mail servers advertised for the domain is actually live.
Address In addition to the Server level checks, validates that the mail server accepts mail for the full email address.

Start a Free 30 Day Trial Today

Start a free trial today