I would like to be able to pass data to Marketo based on a lead clicking a url with utm parameters in it.
Example lead clicks www.xxx.com?utm_lead_source = website. I would then like the lead source field in Marketo to be populated with value of "website".
Does anyone know how to do this? I assume you can with some javascript coding. If it is possible, could someone please provide me with some example code? Thanks everyone.
Solved! Go to Solution.
This is built into both the Froms 1.0 and the Forms 2.0 forms.
Forms 1.0 : Add a hidden field for lead source on your form. Then go to Field Value and Click Edit Settings. Then set the Get Dynamic Value to Get Dynamic Value from URL Parameter. Fill in your default value. Set parameter name to utm_lead_source
Forms 2.0: Add a hidden field for lead source on your form. Then go to Autofill and click Edit. Then set the default value, set Get Value from to URL Parameter and Parameter Name to utm_lead_source
No Javascript required for this one 🙂
If you are using SalesForce, just make sure the hidden field is syncing to both your leads and contacts if you want it to go to both.
This is built into both the Froms 1.0 and the Forms 2.0 forms.
Forms 1.0 : Add a hidden field for lead source on your form. Then go to Field Value and Click Edit Settings. Then set the Get Dynamic Value to Get Dynamic Value from URL Parameter. Fill in your default value. Set parameter name to utm_lead_source
Forms 2.0: Add a hidden field for lead source on your form. Then go to Autofill and click Edit. Then set the default value, set Get Value from to URL Parameter and Parameter Name to utm_lead_source
No Javascript required for this one 🙂
If you are using SalesForce, just make sure the hidden field is syncing to both your leads and contacts if you want it to go to both.
I created the two new fields "utm_campaign" and "utm_keyword" as requested above.
I then went to the page with the parameters populated in the URL, but it's not working. I looked at the page source and found the parameters, but the values aren't being grabbed from the URL. Here is the page source:
<script type="text/javascript">
var mktoPreFillFields = {"Last_PPC_Campaign__c":null,"Last_PPC_Keyword__c":null};
even after I added the following to the page and reloaded:
?utm_campaign=TEST-CAMPAIGN&utm_keyword=TEST-KEYWORD
Any ideas of why the values aren't being grabbed?
I tried to add the javascript snippet to the page template in the head>, but that didn't work..
<script language="JavaScript" src="/js/public/jquery-latest.min.js" type="text/javascript"></script>
<script src="/js/public/jQueryString-2.0.2-Min.js" type="text/javascript" ></script>
<script>
// to set cookies. Uses noConflict just in case
var $jQ = jQuery.noConflict();
var utm_keyword = $jQ.getQueryString({ ID: "utm_keyword" });
var utm_source = $jQ.getQueryString({ ID: "utm_source" });
var utm_term = $jQ.getQueryString({ ID: "utm_term" });
var __kk = $jQ.getQueryString({ ID: "__kk" });
</script>
Pls post a link to your LP with the form.
Sharon Freas is correct. This is what the hidden field would look like in Forms 2.0:
Yep, just look up hidden fields and utm/url parameters. There are a lot of threads on it.
Also see my site, and search for that: marketingrockstarguides.com.