Form pre-fill for Marketo forms not hosted on Marketo landing pages

Anonymous
Not applicable

Form pre-fill for Marketo forms not hosted on Marketo landing pages

I just learned that pre-fill isn't available for Marketo forms not hosted in Marketo landing pages. 

Does anyone know a custom way to make Marketo forms auto-fill when hosted on WordPress? Hoping there's a JavaScript trick or something but could be wishful thinking. 

Thanks,

David

Tags (1)
26 REPLIES 26
Stijn_Heijthuij
Level 7

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

Hi David,

From what I've seen and read you can do it with an iFrame.
Both your wordpress and your marketo domain will need to have the same top-level domain (*.yourcompany.com) and the security framework (http:// or https://) will need to be the same.

It's something I'm going to be trying in a couple of days when our Marketo landingpages get their SSL-certification.


Stijn
Dory_Viscoglio
Level 10

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

Hi David, I believe that this is pretty well controlled on sites that aren't Marketo sites (or anywhere the embed code is used), for security purposes. 
Tony_Lanni
Level 2

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

As Stijn said, it works if you use an iframe and not the embed code.  Here is the article with basic instructions: https://community.marketo.com/MarketoResource?id=kA650000000GuJJCA0 
Jep_Castelein2
Level 10

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

Unfortunately, the iframe solution doesn't work for Forms 2.0. If you started with Marketo before Forms 2.0, you still have the option to create Forms 1.0 forms. 

It is possible to custom build a pre-fill mechanism, but it's a fair amount of work for a PHP developer. Either, you need to sync the Marketo Leads to Wordpress, or you need to make a real-time call to the Marketo REST API to retrieve the data and then pre-fill. 
Ulf_Deeg
Level 3

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

What would keep you from creating a Landing Page with a Form 2.0 and pull in the LP in an iframe?

Anonymous
Not applicable

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

According to that web page about iframes, this approach only works for Marketo Forms 1.0. We're using 2.0.

Any other ideas? 
Anonymous
Not applicable

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

Thanks Jep. In our case, we have SPARK edition. So, we don't have access to the Marketo API. Any information out there on how to sync the Marketo leads to Wordpress? Just trying to gauge how many development hours would be required. Sounds like this may be quite a task. 
Anonymous
Not applicable

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

@Jep. How would we go about doing that Marketo REST API call? Can you point to any documentation?
Aida_Kamber
Level 2

Re: Form pre-fill for Marketo forms not hosted on Marketo landing pages

I was able to find some documentation here: http://developers.marketo.com/blog/external-page-prefill/

However, we are still having issues and getting errors when testing this using Rest API.

Here is the info our developer has sent me outlining the issues. Can anyone help?

As per above link to prefill in external non marketo , we need to first authenticate with marketo and after that we can access the data from marketo. When we tried to access rest api for authentication, we received an error due to cross domain (here is the error message XMLHttpRequest cannot load https://007-aqx-577.mktorest.com/identity/oauth/token?grant_type=client_cre…3b4e-4f3d-aaca-1251c1323.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://jord.webstarts.com' is therefore not allowed access.)

Below is code snippet:-

<script>
alert('testentryfunction');
var url = "https://007-AQX-577.mktorest.com/identity/oauth/token?grant_type=client_credentials&client_id=300e44...";
var client = new XMLHttpRequest();
client.open("GET", url, false);
client.responseType = "application/json";
client.setRequestHeader("Content-Type", "application/json");
client.setRequestHeader("Access-Control-Allow-Origin", "*");
client.send();
alert('testexistfunction');
</script>

We tried accessing the same url with chrome poster and it's working fine, but when we are adding it into a site exposed over the Internet for testing, we are getting an error. This call is going through a browser and I think we can’t use these API’s directly from a browser. If this is true then do we need to first call rest API from .Net, get data and then pre-populate on form when it's loaded?