Kupferman.com

Real E-Mail and Zip Code Validation for Surveys

Why don’t more survey software packages offer zip code validation or real e-mail address validation? I don’t just mean syntax validation — anyone can offer that (although it is interesting that not everyone does). I mean real zip code validation where the postal code is looked up in a database or an e-mail address is tested as soon as it is entered to verify that it is real. It seems that both of these  features would be easy to implement and would be of much use to the client.

Update: It turns out that SurveyGizmo already offers email validation lookup. This means that when you do a survey on their system and validate it using their software, it will check to make sure that the server exists! See their blog posting for details.

Zip Code Validation

There are about 42,000 zip codes in the United States. In Canada there are over 800,000 unique postal codes, although for most purposes (at least, for most survey purposes I’ve ever heard of) the first three characters (the “FSA”) is more than enough and there are only about 1,500 of those. It wouldn’t be hard for a survey software to offer a feature that validates postal codes as they were entered. Which is to say that with a database of less than 45,000 records it would be fairly easy for to automatically validate zip codes as they were entered.

Any why just validate? I can only imagine that a lot of clients would appreciate the option of knowing the city, state, census region, and even latitude and longitude of the people who take their survey based on the zip codes that they enter. All this information is inexpensively available at places like zipcodedownload.com and can be easily integrated into online applications.

E-Mail Address Validation

Real-time e-mail address validation is even easier because it doesn’t require a database. While a lot of survey systems (but again, not all) offer syntax validation, what is much more useful is real-time e-mail address validation where the system uses a component to contact the the respondent’s e-mail server to verify (a) that there is a server there (dns lookup); (b) that it is a mail server (mx record lookup); (c) that it can accept e-mail (smtp server validation); and (d) that the user has an e-mail address on that system.

All of these things are very easy and very fast to do (the deeper you get into it, the longer it can take — for example, verifying that an account exists on a server can take 30 seconds if the system even gives a reply — which is why I usually only go to the level of testing whether there is an active smtp server). Plus it almost guarantees that the e-mail address that ends up in the data base is a valid, working e-mail address.

For example, whenever someone starts one of my surveys I have them first enter their e-mail address — this is so that I can later award them a prize in whatever sweepstakes I have going on at the time. Since it would be troublesome for everyone if the e-mail address they give us doesn’t work, before I start the survey I first validate their e-mail address using a component called aspNetMX. If the e-mail address is valid (or at least links to a valid e-mail server) then I start the survey. If not, I have them re-enter their address until they get it right. You’d be amazed how many people will mistype an e-mail address over and over again (I keep a log of the errors so I can make sure it is working properly, and the errors usually are really respondent errors).

Once again, it would be a great feature to the client (and something you could promote as a feature of your software) if you offered real validation whenever possible which helps the client have better, cleaner data.

3 comments for “Real E-Mail and Zip Code Validation for Surveys

  1. August 24, 2010 at 11:04 pm

    This email validation is a great idea. I see it as an option because if it is going to take 30 seconds to check, I don’t want to lose them either. What if they misspell their email 3 times? That’s a minute and a half! So if it not that important to have the right email, I might just only need the text validation.

    I’m unclear about zip code. For the zip code you are just suggesting to look it up on a database and make sure it’s there?

    I’m glad I found this blog today.

    • August 24, 2010 at 11:12 pm

      E-mail validation can take longer or shorter depending on the level to which you check the e-mail address. For example, if I just check to see that the domain they entered is correct, it will take less than a second. If I check to make sure there is really an e-mail server at domain they gave, that will only take a couple of seconds as well. What can take longer is testing whether or not the account exists at the server.

      For most applications, I would recommend checking to the SMTP server level (which makes sure they entered their domain name correctly). It only takes a couple of seconds, and it will go a long way towards ensuring that you have a valid, working e-mail address. But it would be *great* if the survey software gave you the option of how far you want to go to check the e-mail address.

      In terms of the zip code validation, yes — it would largely validate whether they entered a real zip code. But it could also give you the option of appending information about the zip code to the data file that you download. Which is to say that while many people ask for zip code, they also end up asking for state and region because they don’t have the proper translation table. If the survey software figured out the state, the city, etc. based on the zip code you wouldn’t have to add all of those questions.

      Another things that would be a great feature is the ability to skip and branch based on geographic information (based on the zip code). So, for example, it would be handy to skip to a certain set of questions if I *know* that the respondent is from a specific state.

  2. Eric
    August 30, 2011 at 10:13 am

    For Postal codes in Canada, if surveys could offer validation such as A1A 1A1, that’d be a major step!

Leave a Reply