Embeded form - Auto-fill a "checkboxes" field with a value based on referral page

derelict_wombat
Level 5

Embeded form - Auto-fill a "checkboxes" field with a value based on referral page

I have a request from a business partner who is looking to have a specific value filled in a checkboxes field based on the referral page. Currently they have a static Contact sales page where they link to to from a CTA button on the page.  The form embedded on the page has a checkboxes field with a list of products and the customer can select multiple products of interest.  They would like to keep the experience the same but want one of the values of the checkboxes field pre-checked based on the prior page that they arrived from. 

Example: 
The form has a Checkboxes field with the following product values and a customer can select what products they are interest in. 
- Apples
- Oranges

- Mangos

- Pineapples

 

A customer who is on the Mangos product page clicks the contact CTA and goes to the contact sales page and sees that Mangos checkbox is selected. They can then choose to check addition values in the checkboxes field if they want to.  

Wondering if this is possible? 

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Embeded form - Auto-fill a "checkboxes" field with a value based on referral page

This is very easy if the referring page and form page are on the same origin and the owners of the referring page haven’t deliberately blocked the full referrer from being passed. See MktoForms2 :: Simple referrer path to setValues.

 

Browsers don’t pass the full referrer across origins by default anymore, as it’s a privacy risk. https://pages.example.com and https://www.example.com are not the same origin, by the way: “same origin” means exact hostname + protocol match.

 

Across origins, you’d need to pass the field as a query param. You’re not gonna see enough of the referrer in that case.