SOLVED

Re: Get 3rd party form into Marketo

Go to solution
Anonymous
Not applicable

Get 3rd party form into Marketo

How can I take the form from this 3rd party webpage and send the information over to Marketo? Is this a webhook thing? If so how do I do it.

Web page i am trying to transfer data from.

http://promo.shindigz.com/unsubscribe
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Aqeel_Akbar
Level 4

Re: Get 3rd party form into Marketo

12 REPLIES 12
Aqeel_Akbar
Level 4

Re: Get 3rd party form into Marketo

Anonymous
Not applicable

Re: Get 3rd party form into Marketo

You can do an HTTP Post from a third party form to a Marketo form. Here is a step-by-step guide on how to do this: https://community.marketo.com/MarketoDiscussionDetail?id=90650000000PYzlAAG
 
Kenny_Elkington
Marketo Employee

Re: Get 3rd party form into Marketo

I would strongly encourage you to use the SOAP or REST APIs in lieu of the HTTP POST method.  If you do choose to use HTTP POST, please reference this article for an up to date explanation of this functionality: http://developers.marketo.com/blog/server-side-form-post/
Anonymous
Not applicable

Re: Get 3rd party form into Marketo

Hey Kenny, can you elaborate on why the APIs are superior to the server side form post? 

We currently use the SOAP APIs to link our external forms which does work fine, but we have had occassional issues when associating the new record with the munchkin cookie, with the anonymous activity not associating properly.

The server-side post seems a bit neater as you can just pass the cookie ID in, although I haven't tried it yet. So would be interested on the pros and cons from your perspecitve. 
Kenny_Elkington
Marketo Employee

Re: Get 3rd party form into Marketo

Hey Justin,

POSTing is an artifact of Marketo Forms and was not designed for data transmission outside of forms.  There are IP-based rate limits on the end point which can blacklist an IP instead of throwing an exception to wait(designed to prevent spamming), and the endpoint will not return meaningful exceptions or errors to catch effectively.  The APIs are designed for server to server transmission, report actionable exceptions, and have much more graceful rate-limiting in the case of REST.
Anonymous
Not applicable

Re: Get 3rd party form into Marketo

That is super helpful, thanks Kenny. 
SanfordWhiteman
Level 10 - Community Moderator

Re: Get 3rd party form into Marketo

@Kenny E While the rate-limiting may be easier to deal with using REST or SOAP, that's only if (1) one is able to schedule requests asynchronously using the API call, but not with one's implementation of server-side form post (which is really a coding issue) and (2) one is unable to maintain an internal request counter to avoid blacklisting (again, a coding issue).

Mathematically, 30 requests/min = 1800 requests/hr = 43,200 requests/day, which is actually greater than the 10,000 requests you can make with the API.  Thus if you use a counter to ensure that you don't get blacklisted, and your server can schedule the form posts async w/retries, you should have greater capacity with the form post.

The point about meaningful exceptions is certainly a good one.
SanfordWhiteman
Level 10 - Community Moderator

Re: Get 3rd party form into Marketo

@David P do you have access to add JS code to the Shindigz page?  Do you get a copy of the Shindigz data via email or via their API?  Please explain how you would plan to intercept/replay the form post in the first place.
SanfordWhiteman
Level 10 - Community Moderator

Re: Get 3rd party form into Marketo

@David P I see now that you are Shindigz!

That will make it quite easy to integrate fully on the client side, without any server work at all and no rate limit worries. What you want to do is add an additional submit event listener to your form that re-packages the same form data and sends it to Marketo on the same button click.

For example:

form.addEventListener('submit',function(){
var fd=new FormData(this);
fd.append('munchkinID','<your munchkin id here>');
fd.append('formID','<form id here>'); fd.append('Email',this.querySelector('INPUT[type="email"]').value);
// fd.append() all additional Marketo fields here

// this should also check to see if form was considered valid -- passed via first event listener
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://app-xx01.marketo.com/index.php/leadCapture/save2');
xhr.send(fd);

})


I tested this on your page and it worked fine.  The only caveat is that if the Shindigz doesn't pass your validation, your first (Shindigz) submit listener needs to tell the next (Marketo) listener about that.  Otherwise, the Marketo post will go through even if the Shindigz one is stopped.) Should be easy to do.  

Also, this code is known to not work in IE versions < 10 -- generally when I post PoC samples I am not building in backward compatibility, that would be for production work.

EDIT: On your form, one way I can see to relay validation status from one listener to the other is to check (this.querySelector('DIV.email-form-messagebox-wrapper').style.display == 'none') -- i.e. whether a message box is currently popped up.  Not the cleanest way of doing it but works.

EDIT2: This forum really should have better code embedding because some of us are posting HTML, CSS, and JS here.