Skip to the content

Shopify Plugin

Our integration for Shopify supports the following features:

  • PredictiveAddress
  • International Telephone Validation
  • Email Validation
  • Unusable Name Validation

Our integration does not work at checkout. Shopify have a restricted adding custom code to checkout to Shopify Plus members only! Therefore we have not been able to test our integration on checkout.

Installation

To integrate Data8 Validation or PredictiveAddress into your Shopify site, edit your theme code (theme.liquid) and paste the following after the footer section:

    <!-- Data8 Custom Validation Code -->
    <script type="text/javascript">
      var data8_ajaxKey = 'Your-Api-Key-Here';
      var data8_useOnBlur = false;
      var data8_usePredictiveAddress = true;
      var data8_useSalaciousName = true;
      var data8_emailValidationLevel = 'Address';
      var data8_useTelephoneValidation = true;
      var data8_useLandlineValidation = false;
      var data8_useMobileValidation = false;
      var data8_defaultCountryCode = '44';
      // Additional Settings: Custom Fields
      var data8_customEmailFields = ['example_E-mail_Field', 'eAddressField2'];
      var data8_customPhoneFields = ['example_TelField', 'telField2'];
      var data8_customNameFields = ['example_firstN', 'example_lastN'];
      var data8_customAddressFields = [
        { element: 'company_FieldId', field: 'organisation' },
        { element: 'street_1_FieldId', field: 'line1' },
        { element: 'street_2_FieldId', field: 'line2' },
        { element: 'city_FieldId', field: 'town' },
        { element: 'region_FieldId', field: 'county' },
        { element: 'zip_FieldId', field: 'postcode' },
        { element: 'country_FieldId', field: 'country' },
      ];
    </script>
    {{ 'https://webservices.data-8.co.uk/javascript/shopify.js' | script_tag }}
    <!-- /Data8 Custom Validation Code -->

Should you ever wish to remove the Data8 Validation or PredictiveAddress from your Shopify site, simply remove the Data8 code from the theme code file (theme.liquid).

Configuration

To configure the validation to suit your needs, open the theme code file (theme.liquid) and change the value of the variables to suit your needs. An API key is required to use any of the validation or PredictiveAddress services. Each validation service requires the necessary credits to function.

The Data8 validation in Formstack is compatible with multi-page forms and also with the 'skip validation between pages' option.

Usage

After setting up the options to suit your needs, the relevant enhanced data capture and validation will be applied to the appropriate fields on data-entry points around your site. The standard name, email, telephone and address fields will be validated accordingly. Custom/extra fields can be added to the configuration through the 'custom_..' variables in the settings.

The following rules can be used to attach Data8 Validation to acceptable fields:

  • Email: Either a field name attribute containing email or a text input of type email, or an id attribute listed in data8_customEmailFields.
  • Telephone: Either a field name attribute containing phone or a text input of type tel, or an id attribute listed in data8_customPhoneFields.
  • Name: A field name attribute containing name (excluding username and company name) or an id attribute listed in data8_customNameFields.
  • Address (PredictiveAddress and Postcode Lookup): Field id's for custom address fields can be added data8_customAddressFields in the following format. (Only 'line1' and 'postcode' are required):
[{ 
      "line1": "",
      "line2": "",
      "line3": "",
      "city": "",
      "county": "",
      "country": "",
      "postcode": "",
      "company": ""
  }]

PredictiveAddress

When PredictiveAddress is enabled, any suitable address entry section on your forms will have use of our address autocomplete and verification tool. Simply begin typing an address/postcode/company name into the Address line 1 or company box to start searching and narrowing down results.

PredictiveAddress

Validation

If entered data is identified as invalid, the error will be highlighted suitably on the form.

When Telephone Validation is enabled, all suitable telephone number fields are validated automatically. There are also three other options available to you for further control of validation: Landline Validation, Mobile Validation and Default Country Code.

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.

When Email Validation is enabled, all suitable email address fields are validated automatically. The level of validation to apply to entered email addresses can be selected from a drop down on the settings page. See the table below for information on each level.

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.

When Name Validation is enabled, all suitable name fields are validated automatically.

Validation

The number of returned mail reduced by 28% as a result of the integrated reference to the goneaway file

Business Strategy Manager, Brookson Ltd

Start a Free 30 Day Trial Today

Start a free trial today