How To Pre-Populate Form Fields On Quizzes

Pre-populate email opt-in form on quizzes with customer data via the embed code.

Written by Matthew Clark Updated over a week ago

Customer data passed to the quiz will be automatically used to pre-populate the form fields in the opt-in form. If all form fields have been provided the opt-in form will be automatically submitted and not shown to the quiz taker.

Using the iFrame Embed Code

If you are using the iFrame embed code to embed your quiz on your website, you can pass existing customer data to the quiz using URL parameters.

You can append data to the end of the source URL of the iFrame using the following formula:

&user.field_id=field_value

For example, you could pass the value of a customer's email address and first name by appending the following string to the end of the source URL:

Here is a list of acceptable field IDs that you can pass via the user object:

Email Address - email

First Name - first_name

Last Name - last_name

Company Name - company

Phone Number - phone

Zip Code - zip

Putting all of these steps together, your Javascript embed code should now look like the following using the current example:

Frequently Asked Questions

When should I use the feature to pre-populate form fields?If you have a website where you track your existing customers and have their contact info readily available (usually via tracking code), you can use this feature to prevent known users from having to re-enter their contact information on your Interact opt-in forms.For example, if a user John is logged into your website and you already have access to his contact information, let's say an email address of john@example.com, you can pass this known data into your existing Interact quiz to automatically fill out the requested information in the opt-in form. This is helpful because the user feels like they aren't providing their info all over again if they have already done so elsewhere on your website.

Will this prevent the opt-in form from being shown to my users?If you pass in all of the required information that is requested on your opt-in form, the opt-in form will not be shown to the user. It is important to note that although the opt-in form is not being shown to the user, it does still submit the form and run any automations you have set up.For example, if you have an Interact opt-in form that requires First Name and Email Address, and you pass the data John (First Name) and john@example.com (Email), all fields are complete and the opt-in form will not be shown to the user.

Form fields are still not being updated with the data I am passing in, what can I do?Many of the issues with this feature come from the step where you are writing code to pre-populate the contact information. It should be noted that this is an advanced feature and should only be attempted by your website administrator or someone who has direct access to your website scripts.One common misconception is that the contact information of your users can be automatically pulled from the browser or by our app. However, the contact information of your users must already be known by your website and stored in a way that is accessible to be passed via URL parameters or Javascript.