Skip to main content
All CollectionsForm Submit
How to Embed a Form on Your Website Using API Code
How to Embed a Form on Your Website Using API Code
S
Written by Support Mailtarget
Updated over a week ago

In this article, you will learn how to embed a Form directly on your website using API code. This configuration is specifically for creating more customizable Forms. Therefore, you need to know some HTML coding. To integrate it, follow these steps:

  1. Go to the 'Form API' menu.

  2. Select the Form you want to embed on your website. Then, click the 'More' button and choose 'Embed Code'.

  3. Click the 'API' tab. Here, you will see several parts of the Form. Pay attention to the Endpoint and Request sections.

Note:

Endpoint will be the link connecting the Form on your website to your MTARGET account, and Request is the required field in the Form code that needs to be included in the HTML Editor.

If you use components like chatbox, multiple choice, or any component with more than one option, you need to add "[ ~ ]" (without spaces) between the values. This serves as a connector between values. For example, if you use the values Male and Female in your checkbox, the values should be like this:

{
"email": "String",
"home": "String",
"checkbox-X10": "Male[ ~ ]Female", (WITHOUT SPACES)
"multiple-Sq5": "String"
}
  1. Prepare the code that you have customized with the Endpoint and Request of the Form.

  2. Now go back to your website. Choose the settings that allow you to insert and modify HTML code on your site.

  3. After finding it, select the location where you want the Form to appear.

  4. Paste the customized HTML code into your website.

  5. Save the configuration. Open your website to check if the Form appears in the correct location.

All data entered by users in the Form will be integrated into the Form campaign in your MTARGET account.

Did this answer your question?