Coding on non marketo landing page to prepopulate fields

Anonymous
Not applicable

Coding on non marketo landing page to prepopulate fields

I am sending an email from marketo to a non marketo landing page and form. I am wanting certain fields to prepopulate (name and company name plus a hidden account number)  but not sure what coding to put in the page/form.

The URL is updated to include tokens which capture these fields but I need to work out the coding to then transfer this to  the form.

If someone can help that would be great thank you.
Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Coding on non marketo landing page to prepopulate fields

The email would include the tokens to build the URL such as http://www.example.com/?CompanyName={{company.Company Name:default=MyCompanyName}}&AccountNumber={{company.SFDC Account Num:default=000000}}


JavaScript/jQuery can capture the URL parameters and pre-populate the fields in the non-Marketo landiong page.

It would be something like:

<s c r i p t language="Javascript" src="/js/public/jquery-latest.min.js" type="text/javascript"></s c r i pt>
<s c r i p t src="/js/public/jQueryString-2.0.2-Min.js" type="text/javascript" ></s c r i p t>
<s c r i p t >
  var $jQ = jQuery.noConflict();
  var pCompanyName = $jQ.getQueryString({ ID: "CompanyName" });
  var pAccountNumber = $jQ.getQueryString({ ID: "AccountNumber" });
 
document.getElementById("CompanyName").setAttribute("value", pCompanyName);
document.getElementById("AccountNumber").setAttribute("value", pAccountNumber);
 
</s c r i p t>
 
*** Please note "script" is a single word without spaces. I have separated to avoid the system interpreting as a real tag. ***

Anonymous
Not applicable

Re: Coding on non marketo landing page to prepopulate fields

Thanks for your help.