Embedding a Marketo form in a non-Marketo LP | Community
Skip to main content
Nina_Khalil
Level 2
September 14, 2016
Question

Embedding a Marketo form in a non-Marketo LP

  • September 14, 2016
  • 4 replies
  • 2734 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

September 14, 2016

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
September 14, 2016

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
September 14, 2016

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 7
September 15, 2016

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.