Search the Omeda Knowledge Base

< All Topics
Print

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.

  1. Create a field to capture the URL that the user is navigating away from. Follow these steps in Content:
    1. Click Form Elements > Field > Create +.
    2. Enter returnurl for both the web label and short description, and set the max length to 999. Leave the remaining fields as they are.
  2. Create a redirect to include this return url. Follow these steps:
    1. In Content, click Integrations > Redirect > Create +.
    2. Give the redirect a description you will recognize, such as “Return URL Redirect.”
    3. Make sure the format is set to Redirect and leave the output format as Text with Label.
    4. The Url box should include the merge variable for the field you created in step one. To find the merge variable, search the name of the field under the Merge Variables section.
      1. Select Internal Use and search for your returnurl element.
      2. Place your cursor in the Url box at the bottom and then click on the Merge Variable bubble. This will populate the Url box with that merge variable.
      3. 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.

  1. Place the returnurl field on the first page to enable the form to capture that url.
    1. In the left-side menu, navigate to Form Elements > Field > find your returnurl element (or use the search bar in the upper left hand corner) and drag this into any content box on the first page of the form. Click save.
    2. Open the returnurl element by clicking the pencil/paper icon that appears on the right side of the element.
      1. In the right panel, set the Field Display to Hidden.
      2. 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.
      3. Click Save.
  2. Place the redirect on the last page of the form. In the left-side menu, navigate to Integrations > Redirects > find your element. Drag this anywhere on the page and click save.

Screenshot for step 1

Screenshot for step 2

To test:

  1. Go to the first page of your form and click Preview at top right.
  2. Add the following string onto the end of the URL that appears in the address bar, and then click enter: &returnurl=https://omedatraining.wpengine.com.
  3. 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.
  4. 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).
Table of Contents
Scroll to Top