Articles on: Create, publish & manage

Embed a Marketo form

To embed a Marketo form in a Maglr publication, copy the form's embed code in Marketo and paste it into a new embedded form on a Form element in the editor. The same Marketo form can also be used as the form of a content gate.


Maglr can embed forms from Hubspot, Marketo, Pardot and Mailchimp. You can also build a form in Maglr itself.


Getting the embed code from Marketo


The embed code is the code Marketo gives you to place a form on another website. To copy it:


  1. In Marketo, open the form you want to embed.
  2. Open the Form Actions menu and choose Embed Code.


Image: retrieving the form embed code in Marketo


  1. Copy the complete embed code from the window that opens.


Image: form embed code in Marketo


Copy the code exactly as Marketo shows it. Maglr reads the script, the form ID and the form-loading line from the code, so a partial or edited code won't show the form.


Adding the Marketo form to a page


To add a Marketo form to a page, you add a Form element and then create an embedded form for it in the form editor. You need the complete embed code from Marketo for this.


  1. Open the page in the editor.
  2. Click Add in the left panel.
  3. In the Specials category, add the Form element to the page.


Image: form element in the editor


  1. With the Form element selected, click Select or edit form in the right panel. The form editor opens on the Forms overview.
  2. Click New form.
  3. Click Embed an existing form.
  4. Enter a name in Form name. A form can't be saved without a name.
  5. Under Type code, select Marketo.
  6. Paste the complete Marketo embed code into the code field. A preview of the form appears on the left.
  7. Optional: under Extra options, enter a Redirect URL. After a successful submit, the whole page goes to this URL. Only URLs that start with https:// work.


Image: form settings in Maglr


  1. Click Save form. You return to the Forms overview.
  2. Click Select form next to your new form. The form editor closes and the form appears on the page.


The Forms overview lists every form in your account's form library, and these forms are available in all your projects. To reuse a Marketo form you already added, click Select form next to it at step 5 instead of creating a new one. To edit a form, click the pencil icon next to its Select form button.


The Select or edit form button only works in desktop view. In mobile view, the right panel shows "The form can only be edited on desktop."


Using your Marketo form as a content gate


A Marketo form can be the form of a content gate: an overlay with a form that visitors fill in to keep reading the publication. You choose the gate's form in the project's content gate settings; see Configure a content gate.


When a visitor submits the Marketo form, Maglr receives a signal that the form was completed and closes the gate overlay. To make sure Maglr receives this signal, add Maglr's thankyou.js script to the form's thank-you (follow-up) page in Marketo:


  1. In Marketo, open the thank-you (follow-up) page of the form.
  2. Add this script to that page:


<script type="text/javascript" src="https://forms.maglr.com/static/thankyou.js"></script>


If you can't add a script to the thank-you page, set the form's thank-you (follow-up) page URL in Marketo to https://forms.maglr.com/confirm instead. This page sends the same signal to Maglr.


Enter https://forms.maglr.com/confirm only in Marketo, as the form's thank-you (follow-up) page URL. Don't enter it in the Redirect URL field in Maglr: that field sends the whole page to the URL, so visitors would leave your publication.


Frequently asked questions


Do I need the thankyou.js script if my Marketo form is not a content gate?


No. The script on the Marketo thank-you (follow-up) page only tells Maglr that the form was submitted, which is what closes a content gate. A Marketo form embedded on a page works without it.


Can I use the same Marketo form in several projects?


Yes. Forms you add in the form editor are saved in your account's form library, which you see in the Forms overview. To use a form in another project, add a Form element there, click Select or edit form and click Select form next to the form.


Why can't I edit the form in mobile view?


The Select or edit form button on a Form element only works in desktop view. In mobile view, the right panel shows "The form can only be edited on desktop." Switch the editor to desktop view to choose or change the form.

Updated on: 20/10/2026