AnsweredAssumed Answered

Passing a utm to a form in an iframe

Question asked by b046db3e1a842f19394234e3d0f0af8cfdbdee8b on Jan 27, 2014
Latest reply on Mar 12, 2014 by b046db3e1a842f19394234e3d0f0af8cfdbdee8b
Hi All,

I have read through this article from Marketo on passing utms parameters to a form in an iframe and to be honest it doesn't give enough information.

I want to know where in the js does it say the field in the database this feeds to? I don't want it to go to leadsource as we populate this a different way. I want to have it populate utm_campaign, utm_source field etc I have set up in the database. 

The script says to duplicate the yellow section but it doesn't tell you what to amend.

Has anyone done this?

Here is the script below I have amended but I don't know where to change the fields it goes into:

<script src="//"></script>
<!-- Keep your jQuery up to date -->
    var url = (window.location != window.parent.location) ? document.referrer: document.location;
    var sourceParam = getUrlVars(url)["source"];
    var sourceParam = getUrlVars(url)["medium"];
    var sourceParam = getUrlVars(url)["campaign"];
    var sourceParam = getUrlVars(url)["term"];
  function getUrlVars(url) {
    var vars = [],
    var hashes = url.slice(url.indexOf('?') + 1).split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars[hash[0]] = hash[1];
    return vars;