In this guide, we will walk you through the integration of opt-in forms with affiliate IDs for effective marketing strategies. We will show you the detailed process of hardcoding affiliate IDs in Mailvio forms, designed for pre-launch scenarios and essential use cases. By embedding Mailvio opt-in forms in renowned landing page builders like Convertri, you can achieve secure and efficient data capture during crucial stages of your marketing campaigns.

In this example we're using Convertri as our page builder, instructions will differ a bit depending on which website/funnel builder you are using but it will be similar enough for you to set it up still.
Step 1: Create a New Form in Mailvio
- Log in to your Mailvio account.
- Open the Email Module and navigate to "Forms."
- Click "Create Form" button.
- Select the group list where the contacts will be added.
- Choose Regular Form and proceed to form customization.
Step 2: Choose "Embedded" (NOT Hosted) for Code
- Do not select the "Hosted" option.
- Go to “Embedded” and customize:
- Match design styles (colors, font, button, etc.)
- Confirm your choices.
- Give your form a clear, descriptive name (e.g., Prelaunch Form) — avoid default names like "New Form."
- Click the "Save & Continue" button.
Step 3: Configure Fields and Hidden Input
- Step 1 of the form creation:
- Add Fields:
- First Name (set to "Required").
- Email Address (also "Required").
- Add a Hidden Input:
- Drag and drop the "Hidden Input" element.
- Set the name to your chosen identifier or "Field" (we used Jvzoo_ID in this sample).
- You can leave the "Field Value" blank or insert placeholder text for visual testing (we used JVZ-REPLACE in this sample).
- Click the "Save & Continue" button.
- Skip Steps 2 and 3 by clicking on the "Next" button.
- Skip "Design Template" (Step 4) to avoid getting locked into double opt-in.
If you choose the Design Template, Mailvio will force double opt-in, and it cannot be reverted.
- Upon skipping the "Design Template" (Step 4), also bypassing the Step 5, you will proceed directly to Step 6, where you will copy the Form's code and paste it in Convertri.
- Click the "Finish" button.
Step 4: Embed the Form in Your Landing Page
- You've already copied the Form's generated HTML Embed Code from Mailvio.
- In Convertri, insert an HTML element.
- Click on the "Edit HTML" button and paste the HTML code.
- Click "Save" and "Publish" the page.
Step 5: Locate the Hidden Field Name Using DevTools
- Open the live page in a browser.
- Press F12 to launch DevTools.
- Inspect the form and find the hidden custom field, the value of the Affiliate ID.
E.g.: <input name="customField-567444" type="hidden" value=" {JVZ-REPLACE}">
- What's important is to copy the exact name attribute of that hidden field.
E.g.: customField-567444 (may vary per form)
Step 6: Add Custom Script in Convertri
- In Convertri, go to the page settings for the same landing page.
- Locate the "Custom Scripts" area (usually under "Page" settings).
- Create a new script and make sure it is placed in the 'body' and not the 'head'.
- Paste in the following JavaScript (replace placeholder as needed):
<script>(function () {function getParam(name) {const u = new URL(window.location.href);return u.searchParams.get(name) || "";}const aid = getParam("aid");const selector = '[name="customField-557444"]'; //replace customField-557444 with the element name that you have!!function setValue() {const fields = document.querySelectorAll(selector);if (!fields.length) return false;fields.forEach((f) => {// Set valuef.value = aid;});console.log("Filled", fields.length, "field(s) with aid:", aid); //this line can be removed if you wantreturn true;}// Try nowif (setValue()) return;// Observe DOM until it shows upconst obs = new MutationObserver(() => {if (setValue()) obs.disconnect();});const start = () => {if (!document.body) return setTimeout(start, 25);obs.observe(document.body, { childList: true, subtree: true });};start();})();</script>
Step 7: Test It
- Open the page and append an affiliate ID to the URL. E.g.: https://getquickvsl.com/intro?aid=457438567438
- Press F12 and check the form input.
- Confirm that the hidden field value = 457438567438.
- Submit the form — the contact should be saved with the correct affiliate ID.
NOTE: due to browser caching each time you test and make a change you need to change the aid= value otherwise you won't see the change.

After submitting it can sometimes take a few minutes for the contact to show in the selected group in Mailvio.