Re: Block email suffixes from completing forms?

Mark_Farnell
Level 5

Block email suffixes from completing forms?

Is it possible to block certain email suffixes from completing forms (with a message to advise why) e.g. @gmail.com, @outlook.com, @competitor-domain.com?

Would it involve some form of custom script/html/code?

I assume we could not send information to these email addresses by adding them to a black list or marketing suspend them and use that in the flow of the campaign, but this doesn't look so good i.e. looks like we can't deliver the reply rather than choosing not to.  So would prefer to block these types of email addresses on entry with a validation message.
Tags (1)
13 REPLIES 13
Josh_Hill13
Level 10 - Champion Alumni

Re: Block email suffixes from completing forms?

Try this article. Definitely can be done.
https://community.marketo.com/MarketoArticle?id=kA050000000Kyxo

or do a search on blocking personal email javascript.
Anonymous
Not applicable

Re: Block email suffixes from completing forms?

Below is the code from the article that we place in an HTML object on our landing pages that contain forms.  We've added  checks for over 80 popular public email domains including those that generate temporary email addresses.  The Two Column Forms help article explains how to move error messages in forms.

<!-- Validate the email address field in forms for a non-public domain -->
<script type="text/javascript" src="/js/public/jquery-latest.min.js" language="JavaScript"></script>
<script type="text/javascript">
// set no conflict mode for jquery
var $jQ = jQuery.noConflict();
//edit this list with the domains you want to block
var invalidDomains = ["@123mail.org","@aol.com","@att.net","@bellsouth.net","@charter.net","@comcast.net","@cox.net","@earthlink.net","@gmail.com","@gmx.com","@gmx.de","@googlemail.com","@hotmail.","@juno.com","@live.","@mac.com","@mail.com","@me.com","@mindspring.com","@msn.com","@optonline.net","@pacbell.net","@rediffmail.com","@rocketmail.com","@rogers.com",".rr.com.","@sbcglobal.net","@sympatico.ca","@telus.net","@verizon.net","@web.de","@yahoo.","@ymail.com","@zigmail.com","@bigstring.com","@bumpymail.com","@centermail.com","@centermail.net","@discardmail.com","@dodgeit.com","@e4ward.com","@emailias.com","@fakeinformation.com","@front14.org","@getairmail.com","@ghosttexter.de","@jetable.net","@kasmail.com","@link2mail.net","@mailexpire.com","@mailinator.com","@mailmetrash.com","@mailmoat.com","@messagebeamer.de","@mytrashmail.com","@nepwk.com","@nervmich.net","@netmails.net","@netzidiot.de","@nurfuerspam.de","@oneoffemail.com","@pookmail.com","@privacy.net","@punkass.com","@rmqkr.net","@sharklasers.com","@sneakemail.com","@sofort-mail.de","@sogetthis.com","@spam.la","@spambob.com","@spambob.net","@spambob.org","@spambog.com","@spamex.com","@spamgourmet.com","@spamhole.com","@spaminator.de","@spammotel.com","@spamtrail.com","@trash-mail.de","@trashymail.com","@trashmail.net","@yopmail.com","@wuzup.net"];

function formSubmit(elt) {
// run the custom validation. If it succeeds, run the Marketo validation
if (!isEmailGood()) {
Mkto.setError($jQ("#Email ~ span").prev()[0],"Please enter a business address, not one from a public service");
return false;
} else {
Mkto.clearError($jQ("#Email ~ span").prev()[0]);
}
return Mkto.formSubmit(elt);
}

function isEmailGood() {
for(i=0; i < invalidDomains.length; i++) {
if ( $jQ("#Email[value*=" + invalidDomains[i] + "]").length > 0) {
return false;
}
}
return true;
}
</script>
Michelle_Tizian
Level 10

Re: Block email suffixes from completing forms?

Hey Elliott, thanks for posting the info above.  So if a person enters a @gmail.com or other personal email address, and hits the submit button, the error message that gets displayed is "Please enter a business address, not one from a public service"?  Since implementing this rule, did you see a decrease in your conversion rate? An increase in better lead quality?  I want to use it on a couple of my forms to test against another form that doesn't have the email type restriction.  I have a few Google adwords and Linkedin campaigns in which I'm seeing emails that are mostly non company emails and I'm worried that they won't become actual customers :(.  


Anonymous
Not applicable

Re: Block email suffixes from completing forms?

Amazingly, we saw little or no traffic decline and the quality increased as measured by the %that became MQLs and  Opps.
Anonymous
Not applicable

Re: Block email suffixes from completing forms?

Although this has worked for me in the past, It seems to have stopped working on landing pages recently. Have any of you experienced the same?

Thanks,
Sam
Anonymous
Not applicable

Re: Block email suffixes from completing forms?

The email address field validation is still working on our legacy Marketo forms.  Are you using the new Forms 2.0 on your landing pages?  I understand that the javascript for this may not be compatible with Forms 2.0.
Anonymous
Not applicable

Re: Block email suffixes from completing forms?

Thanks Elliott. 

Yes, the most recent landing pages are using the Forms 2.0 and I was unaware of the issue. 

Have you come accross a solution other than not using the new forms?




Anonymous
Not applicable

Re: Block email suffixes from completing forms?

Glad to see other's are in the same boat -- this code is no longer working on "form 1.0" pages, or form 2.0 pages. Any help or fix is appreciated 🙂
Anonymous
Not applicable

Re: Block email suffixes from completing forms?

yep 😞 just tested Elliott's original code just to ensure i don't have any typos that cropped up over months of adding new domains to block and the form submitted with out error:

http://pages.silkroad.com/testingPURLs.html