Re: Embedding a Marketo form in a non-Marketo LP

Nina_Khalil
Level 2

Embedding a Marketo form in a non-Marketo LP

Hello,

Has anyone successfully embedded a Marketo form in a non-Marketo LP? The form offers the embed code, but by itself, it doesn't appear to be all the code you need. I understand there are two references for this: http://developers.marketo.com/javascript-api/forms/api-reference/ and http://developers.marketo.com/rest-api/assets/forms/examples/ , but as a non-developer trying to handhold my current developer - I need some extra assistance. What exactly would the code look like, if you had basic form objects such as name, company, email?

Tags (2)
4 REPLIES 4
Anonymous
Not applicable

Re: Embedding a Marketo form in a non-Marketo LP

The embed code provided should work just fine. Where in your html are you adding the code? Need some more context to know for sure. The embed code for forms is short because you are just referencing a form id in your instance, nothing in the embed code itself will show fields.

<script src="//app-xxx.marketo.com/js/forms2/js/forms2.min.js"></script>

<form id="mktoForm_1000"></form>

<script>MktoForms2.loadForm("//app-xxx.marketo.com", "000-xxx-000", 1000);</script>

SanfordWhiteman
Level 10 - Community Moderator

Re: Embedding a Marketo form in a non-Marketo LP

Nina, nearly all the forms recipes I've posted on the Community use the embed code on my CodePen site. So those are hundreds of working examples in the wild (and of course there are tens, maybe hundreds of thousands more out there).

Chris_Shaffer
Level 2

Re: Embedding a Marketo form in a non-Marketo LP

Hey Nina, you should be able to use the Embed code without any issue, as long as you're posting the entire thing onto your page.

As far as the API goes, the ONLY time you need to worry about the API is if you don't want to use a Marketo Form for whatever reason, you don't need to use the api when you're using a "native" marketo form even on a non-marketo landing page.

Jessica_Kao3
Level 10 - Champion Alumni

Re: Embedding a Marketo form in a non-Marketo LP

Is it possible that something on the LP is conflicting with the form?  IE there's nothing wrong with the embed code but something on the LP is not playing nice with it.