Skip to main content
May 14, 2013
Question

Coding on non marketo landing page to prepopulate fields

  • May 14, 2013
  • 2 replies
  • 850 views
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.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

May 14, 2013
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. ***

May 16, 2013
Thanks for your help.