Re: Server-side Form Post or API? How are You Capturing Data?

Anonymous
Not applicable
Working on a process where we will use a non marketo form to capture data within a lightbox and then pass it back to Marketo.

I've read Jep's great layout of the Server-Side App Method. Is this updated and still a best practice?
https://community.marketo.com/MarketoResource?id=kA650000000GsXXCA0
  • Any drawbacks or considerations?
  • Leverage Fills out Form for triggers? If so, do you always have to create a different Marketo form to tell the dfference between a demo submission and a WP submission?
  • Support for URL parameters and hidden fields?
  • Any other recommendations like soap API?


 
Tags (1)
11 REPLIES 11
SanfordWhiteman
Level 10 - Community Moderator
@Jeff Coveney In the thread @Justin Norris linked to, consider my comment about using a client-side form post to Marketo using the same data you gather in your non-Marketo form.  

Unless you are altering data on your server, there may not be any reason to do server-side anything.  You can use a totally home-built form (or from another fancy form builder) and as long as you have the ability to add another JS onSubmit event to it, you can cross-post the data to Marketo as well.
Anonymous
Not applicable
Hey Jeff, 

We use the SOAP API to sync data submitted in our app's registration form to Marketo. You need to do a SOAP call to create the record then a Munchkin associateLead call to link the cookie with the new record. 

It works well generally and is flexible. One thing to watch out for is we have occassionally had to troubleshoot race conditions between the two calls and sometimes the cookie not linking properly which caused us to lose web activity. We were able to resolve them though.  

I also was quite interested in the server-side form post method because of it's ability to link with the cookie in one step and also simulate an actual form fill out in Marketo. I believe you would need different forms for different purposes so you can differentiate them in Marketo. 

Also check out this recent thread which has some interesting technical discussion of the merits of the two approaches:

http://community.marketo.com/MarketoDiscussionDetail?id=90650000000Q1wEAAS
Justin_Cooperm2
Level 10
There isn't sample code on that blog post but here is what it would look like (also make sure the "app-aba" part of the url is aligned with what it is for your subscription):
 
<form id="myform" action="http://app-aba.marketo.com/index.php/leadCapture/save" method="POST">
<input type="hidden" name="munchkinId" value="Your_Munchkin">
<input type="hidden" name="formid" value="Your_Form">
<input type="hidden" name="Field_You_Want_Updated" value="New_Value">
</form>

Then call submit via JavaScript:

document.getElementById('myform').submit();

Rasmus_Bidstru1
Level 4

Does this still work?

Justin_Cooperm2
Level 10

Yes it does. Are you having difficulties?

Rasmus_Bidstru1
Level 4

Yes i do.

I have tried to use http://app-lon02.marketo.com/index.php/leadCapture/save2 .. but  im just getting an Error 400 all the time and "Form error, no subscription ID" error.

so just a normal <input> from an external form.

Do you know what the "subscription ID" in a form is? i cant find any documentation on it

Justin_Cooperm2
Level 10

You have code exactly as I have above? Including munchkin ID and form ID?

Rasmus_Bidstru1
Level 4

Yes including everything

Justin_Cooperm2
Level 10

Rasmus,

Are you also adding the Email address field so Marketo knows what lead you are trying to update? Otherwise it doesn't make any sense...

Justin_Cooperm2
Level 10

My example is not posting to leadCapture/save2. Are you sure you've tried it using the exact setup I showed above?

Grant_Booth
Level 10

Hi Jeff,

We have a more updated and thorough article on this at the Developer's Blog:

http://developers.marketo.com/blog/server-side-form-post/