Marketo Forms 2.0 embedding nightmare
I’m looking for guidance on embedding Marketo Forms 2.0 into a third-party CMS with limited customization options.
Our CMS is fairly locked down. I have set content modules where I can add HTML, plus separate header and footer code areas in the page settings. Script code only appears to load properly from the footer, so I’ve had to split the standard Marketo embed code:
- The ‘<form id="mktoForm_####"></form>’ goes in the page module.
- The Marketo Forms 2.0 script and ‘MktoForms2.loadForm()’ code go in the page footer.
The form does load and submit, but the issue happens after styling/customization. Any custom CSS added in Marketo Forms appears to get pulled back into the CMS editor after the page is saved. If I leave the page and come back to edit later, the module HTML is filled with Marketo-generated styling and markup. This creates a duplicate styling situation because the styles still exist in Marketo, but now the CMS also appears to be storing/rendering them.
I’m not sure what this behavior is called, but it feels like the CMS may be saving the rendered form output instead of preserving only the original form placeholder.
We previously embedded a Marketo form on other pages, but it required a lot of vendor developer support and what appears to be some global code. My concern is that global form-specific code may conflict with future forms we need to embed on individual pages.
For this current use case, the form is very simple:
- Email address field only
- Placeholder text inside the field
- Submit button
- On-page thank-you/confirmation message after submission
- Needs to be reusable on several pages
- Ideally styled per campaign/brand without global conflicts
I’ll also be meeting with our CMS developers to discuss options, but I’m hoping to understand the Marketo side better.
Has anyone dealt with this kind of issue when embedding Marketo forms into a third-party CMS?
I’d appreciate any guidance on:
- Best practices for embedding Marketo Forms 2.0 in locked-down CMS environments
- Whether there’s a better way to separate the form, script, and styling
- How to avoid CMS/Marketo style duplication
- Whether on-page confirmation messages are best handled in Marketo or with custom JS
- Alternative approaches that are more sustainable than global form-specific code
Any advice, terminology, or recommended implementation patterns would be super helpful. I’m trying to find a scalable way to use Marketo as the form platform without every embedded form turning into a one-off development project.