How to Prefill fields on an OP3 optin form
This feature allows you to pre-fill data in optin form fields on your pages. It does this by using URL mapping - so you can now pass data to other forms from previous forms like an opt-in form to checkout form.
In this guide we'll walk you through the steps on how to accomplish this.
How to Setup the Optin Form Fields for URL Mapping
First, in order to use parameters on optin forms, to either pre-fill the form, or to pass to the next page or the next form (such as from optin form to checkout page), we'll need to set the URL Mapping in the optin form field settings.
The name you use for the URL mapping can be just a bout anything you want. Please note, some external services may provide you with the correct URL mapping they use. In this example we're keeping it simple.
Now, for the Email field we've set the URL Mapping = email
How to construct the URL
Now that we have the optin form setup. Here is how you setup the URL.
Firstly, when you have parameters in a URL, you must begin with using a "?" and then place the parameter like this:
Now when you addon a 2nd parameter, and for any additional parameters, you separate them with the "&" symbol like this:
It does not matter what order the parameters are in, only the first one in the URL needs the "?" in front of it.
Now here you can see the final result how a URL would look like when you want to pre-fill the name and email.
TIP: You can follow the same process for pre-filling other fields, even hidden fields - you'll just need to be sure the hidden field is not marked as hidden in the optin form settings in order to setup the URL mapping on those fields.
Override Form Fields
If you are using custom fields, you can also pre-fill these fields as well. You can use any URL mapping name you want. In this example we'll use "goal" for the custom field:
If you want to set a default text for that field, you can do that as well:
Now, let's say you wanted to email your existing email subscribers about a new coaching package you are offering.
To save time setting up another web form (although it's super quick in OptimizePress) you decide to use a form you already have, but you want to override the form field with the word Coaching and not use the current default field text Grow Email List.
Because we have set the URL mapping we can use the goal mapping and replace that with Coaching by using the following URL:
Here's the result.
We have replaced the default form field text with our new word based off the URL parameter string.
If you would like to take this one step further and pre-fill fields on a checkout form after your leads fill in an optin form, you may find the following guide helpful: https://docs.optimizepress.com/article/2496-automatically-pass-optin-form-field-data-and-autofil-another-form
We hope this guide helps, however, we know it can sometimes be a challenge. If it doesn't work or you have any trouble with this process, simply reach out to support and we'll be glad to help you with it.