Embed a Hubspot form
To show a HubSpot form in a Maglr publication, copy the form's embed code in HubSpot, save it as a form in Maglr's form editor, and select that form in a Form element. The Form element also accepts embed code from Marketo, Pardot and Mailchimp, and it can show forms you build in Maglr itself.
Copying the embed code from HubSpot
To get the embed code of a HubSpot form:
- In HubSpot, create a new form and choose the embedded form option.

- Set up the form's fields.
- Open the form's share or embed options and click the copy button to copy the embed code to your clipboard.

Adding the HubSpot form to a Maglr page
To place a HubSpot form on a page, add a Form element, save the HubSpot embed code as a form, and select that form:
- Open the page in the editor.
- Click
Addin the left panel. - In the
Add elementsdrawer, openSpecialsand dragFormonto the page.

- In the right panel, under
Form, clickSelect or edit form. TheForms overviewopens. - Click
New form. - Click the image above
Embed an existing form. - Under
Embed code, enter a name inForm name. You can't save the form without a name. - Check that
Type codeis set toHubspot. It is selected by default. - Paste the HubSpot embed code into the text box below "How do I add Hubspot code?". A preview of the form appears on the left.
hbspt.forms.create(...) part of HubSpot's embed code. If the code you copied doesn't contain hbspt.forms.create, the form won't appear.- Optional: under
Extra options, enter aRedirect URL. After a visitor submits the form, the browser leaves the publication and opens this URL in the same tab. Enter the full URL, starting withhttps://. A URL starting withhttp://doesn't redirect. - Click
Save form. You return to theForms overview.

- Click
Select formnext to the new form. The popup closes and the form appears on the page. TheFormblock in the right panel now shows the form's type (Hubspot), its name and the date it was last modified.
Fixing HubSpot submissions marked as spam
If HubSpot marks submissions from a HubSpot form embedded in Maglr as spam, add https://forms.maglr.com to HubSpot as a site domain. Maglr loads and submits embedded HubSpot forms from https://forms.maglr.com, and HubSpot can treat submissions from a domain it doesn't recognise as spam. HubSpot explains how to add a site domain in its own documentation: Read more
Frequently asked questions
Can I use the same HubSpot form in several projects?
Yes. A form you save in Maglr is available in all your projects. To reuse it, add a Form element to the page, click Select or edit form in the right panel, and click Select form next to the saved form in the Forms overview. You don't need to paste the embed code again.
Why doesn't my HubSpot form appear after I paste the embed code?
Maglr reads the portal ID and form ID from the hbspt.forms.create(...) part of HubSpot's embed code. If the code you pasted doesn't contain hbspt.forms.create, the form won't appear. Also check that Type code is set to Hubspot in the form's Embed code settings.
Where do submissions of an embedded HubSpot form go?
Submissions of an embedded HubSpot form go to HubSpot, and you view them there. The submission count in Maglr's Forms overview is shown only for forms built in Maglr.
How do I change the embed code of a HubSpot form later?
To change the embed code of a saved HubSpot form, open the Forms overview by clicking Select or edit form in the right panel of a Form element. Click the Edit (pencil) icon next to the form, paste the new embed code, and click Save form.
Updated on: 16/10/2026