Require Business Emails on Your Marketo Forms

Require Business Emails on Your Marketo Forms

A work email address gives you the internet domain name of the person’s employer, which, besides allowing you to reach them with work-related offerings at their work email address, can be a key to unlocking other important data that can be appended to the Person record, including number of employees, revenue, SIC or NAICS codes, and DUNS number. So, if your organization prefers a work or business email address over personal a email address, then you can use this simple solution to add that functionality to forms.

The challenge

To get this rich demographic and firmographic data though, you need to make sure that people are not submitting their personal email addresses on your Marketo forms. We see this request often, both on the Marketo Community and from our own clients. But Marketo does not not natively support this functionality.

The approach

Luckily, Marketo’s Forms 2.0 made available a JavaScript API that we can use to extend the native form functionality — in this case, to add a filter for email addresses entered into Marketo forms.

Using JavaScript, we first define a list of common domain names that are known to provide free email addresses — gmail.com, hotmail.com, live.com, outlook.com, yahoo.com, aol.com. (Of course, there are thousands of other domains like these, but these few are likely the most common that most marketers encounter.)

Next, we need an error message to alert the user that they need to enter their business email address, something like: “Please enter your business email address.”

Finally, we need to create logic that determines whether the submitted email address is in the list of disallowed domains that we created, and, if so, to prevent the Marketo form submission from happening and instead alert the user to enter their business email address.

The solution

The following script does exactly that:

  • define blocked email domains
  • define error message to user
  • determine whether email address contains blocked domain
  • alert user to try again

To use the script, you will first need to download it to your computer.

Download Script

Then, edit the list of domains you want to block if you want something different and update the error message to match your brand voice. Be sure to wrap each domain in quotes and separate them with commas. Do not include a comma after the last domain. (This will break the script.)

var domains = ['gmail.com','hotmail.com','live.com','outlook.com','yahoo.com','aol.com']

var error = 'Please enter your business email address.'

Last, simply upload it to your Design Studio and include in your Marketo landing page template(s) and in your website footer. Your <script> tag should look something like this:

<script src="https://info.example.com/rs/123-ABC-456/images/digitalpi-require-business-email.js"></script>

Alternatively, instead of uploading to Marketo’s Design Studio, you or your web team can add it to your tag manager tool (like Google Tag Manager or Adobe Tag Management).

If added to your pages correctly, the script will fire when needed, automatically detecting Marketo forms on any page where it is included and extending their functionality to require a business email address.

jbourne@digitalpi.com

Jon Bourne is a marketer with a varied background in technology, design, agency consulting and direct sales. He has been a front-end developer, account executive, technology consultant, creative director, and head of marketing as well as an owner, partner and executive in multiple design and development agencies. Jon brings his technical background together with branding and marketing savvy to deliver return-oriented strategies that drive top-line growth and create efficiencies and cost savings for client companies—turning marketing organizations from cost centers to profit centers.

LEAVE A COMMENT