SOLVED

Grabbing Data from URL using UTM Parameters

Go to solution
Anonymous
Not applicable

Grabbing Data from URL using UTM Parameters

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Grabbing Data from URL using UTM Parameters

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.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Re: Grabbing Data from URL using UTM Parameters

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.

Anonymous
Not applicable

Re: Grabbing Data from URL using UTM Parameters

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>

pastedImage_1.png

SanfordWhiteman
Level 10 - Community Moderator

Re: Grabbing Data from URL using UTM Parameters

Pls post a link to your LP with the form.

Jenn_DiMaria2
Level 10

Re: Grabbing Data from URL using UTM Parameters

Sharon Freas​ is correct. This is what the hidden field would look like in Forms 2.0:

Screen Shot 2015-06-18 at 3.25.26 PM.png

Josh_Hill13
Level 10 - Champion Alumni

Re: Grabbing Data from URL using UTM Parameters

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.