Blog / Technical Guides
The MailerLite + Lovable Trap: Why Their Embed Code Fails and How to Actually Fix It
By Keyona Meeks, Founder, ReRev Labs · Feb 9, 2026 · 7 min read
The short answer: Do not paste MailerLite's embed script into a Lovable page. Make a small component that shows your form in an iFrame, using the share link from the MailerLite dashboard. Then test it three ways: in Lovable's preview, on your live domain, and by checking that your test email shows up in MailerLite.
By the end of this post, you'll be able to:
- Add a MailerLite signup form to a Lovable site with a short iFrame component.
- Explain why the pasted embed code tends to fail in a React site.
- Fix the common problems: no form, a form that cuts off, and a form that looks unstyled.
- Know what to try when other pasted embeds, such as scheduling widgets, break in Lovable.
You paste the embed code. The form shows up in the preview, or it does not. You type your own email, press the button, and the button spins. Nothing happens. You are not sure if the form is broken or if you did something wrong.
This is a common trap for people moving from a page builder to a Lovable site. The fix is short. The reason it fails takes longer to explain, so the fix comes first.
What is the fix?
Create a new file in Lovable called NewsletterIFrame.tsx. Put this in it:
import React from "react";
interface NewsletterIFrameProps {
className?: string;
height?: string;
}
export function NewsletterIFrame({
className = "w-full max-w-lg mx-auto",
height = "550",
}: NewsletterIFrameProps) {
return (
<div className={className}>
<iframe
src="https://dashboard.mailerlite.com/forms/YOUR-FORM-ID/YOUR-HASH/share"
width="100%"
height={height}
frameBorder="0"
scrolling="no"
style={{ border: "none", borderRadius: "8px" }}
loading="lazy"
title="Newsletter Signup"
/>
</div>
);
}
Then use it on any page:
import { NewsletterIFrame } from "@/components/NewsletterIFrame";
function HomePage() {
return (
<>
{/* other content */}
<NewsletterIFrame />
</>
);
}
You can also ask Lovable to do it for you. Tell it: "Add a component that shows this URL in an iFrame, 100 percent wide, and put it above the footer," and paste your form link.
Where do you find your form link?
- In MailerLite, open Forms.
- Find your form and click Share.
- Copy the link. It looks like
https://dashboard.mailerlite.com/forms/[FORM-ID]/[HASH]/share. - Paste it into the
srcof the iFrame.
MailerLite's menus and link format can change. If you do not see Share, check MailerLite's help center for how forms are shared now. Checked October 30, 2026: MailerLite's own tutorial page mentions only the embed code and a WordPress plugin, and I could not confirm the share link from an official page. Treat the link steps as the method I used, and test it.
Why does the pasted embed code fail?
I want to be careful here. I know what I saw. I do not have MailerLite's or Lovable's word for the cause. These are the likely reasons.
- A React site draws the page itself. MailerLite's script expects a normal page with a place to put the form. When React builds the page from components, the script may run before the spot exists, or React may redraw over what the script added.
- Scripts pasted as text do not run the way you expect. Putting script text into a component with
dangerouslySetInnerHTMLdoes not behave like a script tag on a plain page. - Preview addresses are different from your live address. Lovable shows your site at preview addresses before you connect a domain. A form tool that checks the address of the page may treat those differently from your real domain.
An iFrame sidesteps all three. Your page only shows MailerLite's own page inside a box. MailerLite's page runs as it normally does.
What did the failed attempts look like?
If you see any of these, you are likely in the trap:
- The Lovable HTML widget with the embed code. The script loads, but the form does not appear, or it appears and does not submit.
- A component using
dangerouslySetInnerHTML. The form shows in one place and breaks in another. - An infinite spinner on submit. The form looks fine, and the button never finishes.
All three go away when you switch to the iFrame, in my experience. Test yours to be sure.
How do you use the iFrame without a component?
If you prefer Lovable's drag-and-drop editor, add an HTML widget and paste this:
<iframe
src="https://dashboard.mailerlite.com/forms/YOUR-FORM-ID/YOUR-HASH/share"
width="100%"
height="550"
frameborder="0"
scrolling="no"
style="border: none; border-radius: 8px;"
loading="lazy"
title="Newsletter Signup"
></iframe>
How do you test it?
- Open the preview in Lovable. Submit the form with your own email.
- Open your live site and do it again. If your domain is not connected yet, see how to deploy a Lovable website to your own domain.
- In MailerLite, open Subscribers and look for the test email. The form may show a thank-you page instead of a message you expect, so check the dashboard and not only the screen.
Do this before you promote the form. A signup form that fails quietly is worse than one that is obviously broken.
What if it still does not work?
The form does not appear at all.
- Check that the form ID in the iFrame
srcmatches your MailerLite form. - Check that the form is published, not a draft.
- Open the iFrame address in a new browser tab. If it does not load there, the link is wrong.
The form appears, but you are not sure submissions work.
- Check Subscribers in MailerLite before you assume it failed. The form may be working.
- Test with an email address you control.
The form is cut off, or there is too much white space.
- Raise the
heightvalue for a long form, such as700. - Lower it for a short one, such as
400.
The form looks plain.
- The iFrame shows MailerLite's hosted form. Change colors and fonts in MailerLite's form editor, not in Lovable.
- You can style the box around the iFrame with Tailwind classes.
What about other embeds that break in Lovable?
The same trap catches other tools that give you a block of script to paste: scheduling widgets, form builders, chat boxes and review badges. The pattern is the same. You paste the code, and the widget does not show, shows once, or breaks after you publish.
Try these in order.
- Look for a link or iFrame option from the tool. Many tools offer a hosted page for the form or widget. If you can open it in its own browser tab, you can show it in an iFrame like the one above.
- Use the tool's own instructions for React sites if it has them. Search the tool's help center for "React" before you paste raw script.
- Ask Lovable to add the widget as a component. Paste the tool's code or link and say what you want. Then run the test below.
- If none of that works, link out. A button that opens the hosted page in a new tab works every time, and the visitor still reaches your form.
I have not tested every tool. Treat this as a method to try, not a promise that each widget will work. Whatever you choose, test it in the preview and on your live domain, and check that the result reaches your own account.
Where this has limits
- You do not control the form's design from Lovable. It lives in MailerLite's editor, inside a box.
- Tracking is harder. An iFrame hides what happens inside it from your page. To count signups, redirect to a thank-you page on your own domain and track that page, or use MailerLite's own reports.
- Search engines see a box. The words inside the iFrame are not part of your page. Put the text you want found, such as why to sign up, outside the iFrame.
- I have not re-tested this on every Lovable and MailerLite version. Both products change. Run the test above after any change to either one.
- Deliverability and consent are separate. This post covers showing the form. Your list, consent wording and email rules depend on where your readers live. Check with a professional if you are unsure.
- Another route. If you only need to collect names and emails and do not need MailerLite's sending tools, you could send form entries to a Google Sheet instead.
If you are paying for a form tool and want to own the setup instead, you can apply on /letstalk. Bring the form, what it collects and where the data goes next. Do not send passwords or login details.
To see what else is worth automating before you hire, read what to automate first in a small business.
Frequently asked questions
Will the iFrame break my responsive design?
No. Set the box width with a class such as w-full max-w-md mx-auto. The iFrame fills the box. On a phone, check that the form is not cut off, and raise the height if it is.
Can I style the form inside the iFrame?
Not from Lovable. Change colors, fonts and layout in MailerLite's form editor. You can style the box around the iFrame, such as padding, a background or a shadow.
What about Lovable's own form components?
Lovable can build a form, but it does not send entries to MailerLite on its own. You would need to connect to MailerLite's API and handle that yourself. The iFrame is the shorter path if you only need a signup form.
Will the iFrame slow down my site?
It loads when the visitor scrolls near it, because of loading="lazy". I have not measured the size or load time, so test your own page if speed matters.
Can I track signups in Google Analytics?
Not from inside the iFrame. Set the form to redirect to a thank-you page on your domain, then track visits to that page. MailerLite also lists its own integrations in its settings, so check there.
Do I need to change anything when I connect my custom domain?
You should not need to change the iFrame. Test the form again on the live domain to be sure.
Read next: Send Lovable form submissions to Google Sheets if you want a form setup with no embed code at all, and add Google Analytics 4 to a Lovable site once forms work and you want to see whether anyone uses them.