SOLVED

Re: Submitting lpID with embedded 2.0 Form

Go to solution
Anonymous
Not applicable

Submitting lpID with embedded 2.0 Form

We're using the Marketo-generated embed code and pulling the lpID from the POST array on submit. In the 1.0 embed instructions, you just set its value to -1:
https://community.marketo.com/MarketoResource?id=kA650000000GvdjCAC

However, since the 2.0 version is built from a JSON object that is missing the lpID field, this presents a problem. I've tried the following to no avail:

        <form id="mktoForm_xxxx" name="mktoForm_xxxxx"></form><script type="text/javascript">
            MktoForms2.loadForm("//app-ab02.marketo.com", "xxx-xxx-xxx", xxxx, function(form){
                $('form').append('<input type="hidden" name="lpId" value="-1" />');
            });

When this is submitted, lpID is missing from the post:

2.0 Post

When the same form is added to a Marketo LP and submitted, lpId is present:

1.0 Post

Any idea how we can get that value into the post?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Kenny_Elkington
Marketo Employee

Re: Submitting lpID with embedded 2.0 Form

Hey Charlie,

You'll want to use the addHiddenFields method of the form like so:

 MktoForms2.loadForm("//app-ab02.marketo.com", "xxx-xxx-xxx", xxxx, function(form){
               form.addHiddenFields({"lpId":9999});
            });

View solution in original post

2 REPLIES 2
Kenny_Elkington
Marketo Employee

Re: Submitting lpID with embedded 2.0 Form

Hey Charlie,

You'll want to use the addHiddenFields method of the form like so:

 MktoForms2.loadForm("//app-ab02.marketo.com", "xxx-xxx-xxx", xxxx, function(form){
               form.addHiddenFields({"lpId":9999});
            });
Anonymous
Not applicable

Re: Submitting lpID with embedded 2.0 Form

Thanks!