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']rrvar 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

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.

Your marketing technology experts.

At Digital Pi, we use technology to connect revenue to marketing efforts. We fuse marketing strategies, processes, data and applications to make marketing technology solutions work for clients' businesses.

Learn More
Share this resource
Facebook
Twitter
LinkedIn
Tags

Cookies help us keep the site running smoothly and inform some of our advertising, but if you’d like to make adjustments, you can visit our Cookie Notice page for more information.