Search the Omeda Knowledge Base
How to send a user back to your website after form submission (redirect to a return URL)
Signing up for a subscription or newsletter should be a seamless process for your users, even when filling out a form that is not embedded on your website. Setting up a redirect to a return URL will send users to the same location on your website where they were browsing before they navigated to your form.
First, set up two elements in Content
These fields only need to be created once; they can be used on any form created.
- Create a field to capture the URL that the user is navigating away from. Follow these steps in Content:
- On the company level, click Form Elements > Field > Create new.
- Enter returnurl for both the web label and short description, and set the max length to 999. Leave the remaining fields as they are.
- Create a redirect to include this return url. Follow these steps:
- In Content (on the company level), click Tools > Export Url > Create new.
- Give the export url a description you will recognize, such as “Return URL Redirect.”
- Set the format to redirect and leave the output format as is.
- The Url box should include the merge variable for the field you created in step one. To find the merge variable, search the content section at the top of the form.
- Select Internal Use in the dropdown box and search for your returnurl element.
- Highlight the merge variable by clicking on it, place your cursor in the Url box at the bottom, and then click insert (back toward the top). This will populate the Url box with that merge variable.
- It is also a good idea to append the olytics encrypted ID in case it is needed. Add this string to the end: ?oly_enc_id=%%0.2.110%%. This merge variable is standard across all databases.
Next, place these two items on your form in Builder.
- Place the returnurl field on the first page to enable the form to capture that url.
- In the left-side menu, navigate to Generic Use > Field > find your returnurl element and drag this into any content box on the first page of the form. Click save.
- Open the returnurl element by clicking the pencil/paper icon that appears on the right side of the element.
- On the Display Options tab, set the control template to Hidden.
- On the Form Options tab, enter returnurl for the inbound parameter. We recommend that you also enter a default value that will be passed along in case a return url value is not passed to the form.
- Click Done to save.
- Place the export URL on the last page of the form. In the left-side menu, navigate to Page elements > Export URL > find your export url element. Drag this anywhere on the page and click save.
Screenshot for step 1
Screenshot for step 2
- Go to the first page of your form and click Preview at top right.
- Add the following string onto the end of the URL that appears in the address bar, and then click enter: &returnurl=https://main.omeda.com.
- Fill out the form as if you are an end user and submit. For this test, the form should redirect you to Omeda’s homepage.
- Run a second test without that string appended to your URL and it will take you to the default URL you entered on page one (if you entered one).