How to prefill form fields?

Tabata Vossen -

When publishing a Qualifio campaign with a form, you can use the URL of the campaign to prefill form fields. By prefilling fields, you can speed up the form-filling process and boost completion rates! Read this article for instructions.

In this article

Overview

When publishing or sending your campaign, you may wish to have some information automatically populated into the fields of your form. This is called “prefilling”.

You can accomplish this using various methods:

  • Prefill through the URL: use a prefilled link with a query string, i.e. a specialised segment after the question mark in the URL.
  • Prefill with JavaScript: add an extra script to your Qualifio embed code, which we cover in this section.
  • Prefill through SSO: use existing SSO data to prefill the form as soon as the participant provides their login credentials. See how it works
  • JWT prefill: use a token-generated prefilled URL. See more about this feature

In this support article, we’ll show you how to prefill form fields using the campaign’s URL.

Typical situation: You created a quiz, which you shared with your database through an emailing campaign. Users who will click on your campaign shouldn't have to fill out fields about their personal information such as their name or email address since you already have the data! In Qualifio, it is possible to prefill these fields.

Here are the 3 steps to follow in order to use this feature:

In order to prefill form fields, you need the prefill link of your campaign. Simply put, we generate a URL that includes the form fields you might want to prefill – so you don’t have to! 🎉

Note: You can prefill form data using the URL when either embedding your campaign (via JavaScript) or publishing it on a minisite.
  1. Open the campaign you want to prefill.
  2. In the Channels step, find the prefill link for your campaign.
  3. Copy the link to your clipboard and paste it into a text editor.

Schermafbeelding_2022-02-25_om_17.28.47.png

Note: If you do not see the prefill link, it is due to the option not being turned on from the Advanced features page. Contact your account administrator for more information.

Normally, the prefill link to a minisite campaign looks like this (line breaks added for clarity):

https://demo.qualifioapp.com/20/action/load.cfm?
ID1234567={First name}&
ID8901234={Last name}&
ID5678901={Email address}&
OID23456={Demo opt-in}&
url=https%3A%2F%2Fproductdemo%2Equalifioapp%2Ecom%2Fquiz%2F843527%5F1077%2Fdemo%2Dcampaign%2Ehtml

and the prefill link to an iframe campaign looks like this (line breaks added for clarity):

https://demo.qualifioapp.com/20/action/load.cfm?
ID1234567={First name}&
ID8901234={Last name}&
ID5678901={Email address}&
OID23456={Demo opt-in}&
url={www.domain.com/page.html}

As you can see, several URL parameter and value pairs are connected by ampersands (&). By pair of parameters and values, we understand ID1234567={First name}. In this structure, 1234567 is the form field ID. Thus, ID1234567={First name} sets the first name for the form field “First name”.

Note that we use 1234567 as the field ID. This example ID will be replaced with the actual ID of your form field.

Step 2: Populate your prefill link with variables

To build your full prefill link and customise the URL for each participant, you’ll need a variable for each of the fields you want to prefill. This variable is usually found via your CRM/Marketing Automation tool.

You can prefill forms with data from Salesforce, HubSpot, MailChimp and other CRM/email systems. Knowing exactly what variable format to use can be difficult, as each provider has its own format. For instance:

  • Salesforce uses single brackets and an exclamation mark: {!EmailId}
  • HubSpot uses double brackets: {{contact.email}}
  • MailChimp uses asterisks and vertical bars: *|EMAIL|*

Depending on the tool you are using, email variables are also known as “personalisation tokens” or “merge tags”. For more in-depth instructions, please reach out to the support team of your CRM tool.

After each equal sign, you’ll want to enter the corresponding variable (whose value will prefill the form field). Here’s what our example link looks like:

Prefilled_URL.png

Prefilling opt-ins

If you are passing through name and email you need to use a link such as:

https://demo.qualifio.com/prefilling-optins/?ID1234567=*|FNAME|*&ID2345678=*|LNAME|*&ID3456789=*|EMAIL|*

Once you have your form fully created with the opt-ins, you'll need to view the prefill URL once again. You'll see something like this:

Screenshot_2020-10-20_at_14.48.17.png

In the image above you can see a URL parameter with the name “OID”, which is the one you need to use to prefill your opt-in. In this case, it is “OID12345”.

To prefill the “OID12345” opt-in, you would simply add your variable (or “merge field”) to the URL. For instance:

&OID12345=*|SUBSCRIPTION1|*

So the final URL, in this case, would be:

https://demo.qualifio.com/prefilling-optins/?ID1234567=*|FNAME|*&ID2345678=*|LNAME|*&ID3456789=*|EMAIL|*&OID12345=*|SUBSCRIPTION1|*&url=https...

When you are passing information from your vendor, you can use the following values:

  • true1 and on will all mark the checkbox (or the "yes" option) as selected;
  • false0 and off mean that the checkbox is not selected (or that "no" is selected);
  • if the value that is passed is empty or not supported, then we'll make sure that the checkbox or radio buttons are not selected.
Note: This is not case-sensitive, so "on", "On" and "ON" are correct.

Step 3: Test your prefilled URL

This URL that you have created will prefill form fields when participants access your campaign:

Schermafbeelding_2022-02-25_om_17.43.43.png

FAQs

Here is some useful information for using prefilled form fields more efficiently.

Can I prefill special characters into form fields?

Yes, but you will need to ensure any special characters and symbols are URL encoded. Check out this website to encode the special characters.

Note: it’s easier to prefill fields which don’t have spaces. Spaces can cause links to break. However, it’s possible to work around this concern. To add a space in prefilled form fields, use the code %20. For example, to obtain the prefilled value Julie Lane for a field, you will need the following code: &ID123456=Julie%20Lane.

Can I prefill as many fields as I want within a form?

Yes. But the more fields you choose to prefill, the longer the link gets, and longer links can easily break. If you send emails with prefilled campaign links, note that URLs are usually supported up to 1,000 characters long. So keep in mind: the shorter the link, the better.

Can I hide a prefilled field on a form so that isn’t visible to the participant?

You can! Nobody wants to repeatedly type the same information into forms. Create a better experience for your participants and keep them coming back for more by already including and hiding their information in your form! To learn more about setting this up, please read this help article.

What about third-party cookies?

To use this feature, we drop a functional cookie on the user's browser. This cookie uses the domain of the iframe that will be prefilled (e.g. bear.example.com).

As of 2018, some browsers started blocking third-party cookies and trackers by default. It is thus important to use an iframe that is on the same domain as the parent page where it’s embedded (in this example: www.example.com). That way, the cookie is not considered a 3rd party cookie and is not blocked.

When you use a subdomain of your domain to publish your Qualifio campaign (e.g. bear.example.com instead of bear.qualifioapp.com), the cookie is considered first-party and isn't blocked by any browser.

How can I update profile information based on form data?

Participants may update or complete their profile information through your Qualifio campaign’s form. So how can you see the changes pushed back to your email system?

To send the data back to your application and update an existing profile, it is possible to use a webhook. With the webhook enabled, Qualifio can push user profile updates to the receiving URL set up in your account. From there, your IT staff should be able to develop custom business rules in order to update the user’s record in your database.

💡 Quick tip: create form fields that are shown even when prefilled so that the participant sees the data pulled from your database and can update them if needed.

Alternatively, if you have a custom push integration with us, updates to user profiles may be pushed to your database. Contact us to talk to an expert.

Related articles

Can’t find the answer you need?

Send us a question and connect with an expert to get personal assistance.

Contact support

Vous ne trouvez pas les réponses que vous cherchez ?

Nous sommes là pour vous aider. Envoyez-nous une demande en direct !

Contacter le support
helpcenter experts