1 Reply Latest reply on Sep 11, 2014 10:33 AM by Grant Booth

    URL Parameter with Forms 2.0 in iFrame

    Tonya Austin
      Hello All,
      I am hoping someone can help.  I implemented a solution using the script found here: (https://community.marketo.com/MarketoResource?id=kA650000000GuKCCA0) with my older forms buf found that it does not work with Forms 2.0.  Can anyone out there help me modify my script to make it work with Forms 2.0?

      Here is what I have right now:

           <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
           <!-- Keep your jQuery up to date -->
               var url = (window.location != window.parent.location) ? document.referrer: document.location;
               var sourceParam = getUrlVars(url)["leadsource"];
             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;

           Any suggestions are greatly apprecaited!  Thanks!