6 Replies Latest reply on Jul 18, 2016 5:08 AM by Elliott Lowe

    Partner Referral Form and pURL

    Elliott Lowe

      We'd like to create a Marketo landing page with a form that will allow authorized partners to submit referrals.  We're going to use a pURL for this, so that only authorized partners will have the form displayed to them.  We'd like to capture the partner's SFDC Account ID into a hidden form field, so the partner doesn't have to enter it. 

       

      One way to do this is to add the Account ID as a query parameter in the link we provide the partner and the form would capture the URL Parameter into a hidden form field  However, if the partner navigates to the page without the link, that query parameter will no longer be available.  We could potentially store the query parameter in a cookie, but it could become deleted, they could initially navigate to the pURL without the query parameter, etc.

       

      Since the partner will be using a pURL, and the LP can have snippets / tokens containing information from that lead's record, I'm guessing it's possible to set the Account ID in a Data Transfer Object and write that value into a hidden form field.  I looked at a few discussions and developers.marketo.com docs for Forms 2.0 and came up with the following HTML to include on the LP, but not surprisingly, it doesn't work (munchkin ID is replaced with x)'s.  I'm sure that I'm not setting or reading the AccountID variable correctly and would appreciate any recommendations.

       

      <div ID="AccountID" style="display:none">{{lead.Account ID (18)}}</div>

       

      <script>

      MktoForms2.loadForm("//app-sj08.marketo.com", "xxx-xxx-xxx", 1769, function(form) {

          // Set the value of the Referring Partner field

          form.vals({"Referring Partner":"AccountID"});

      });

      </script>

        • Re: Partner Referral Form and pURL
          Sanford Whiteman

          You don't need a DTO if you're on an LP.

           

          Just put the token right in the Forms 2.0 JS (assuming this is a field you can't bring into the form directly as hidden w/PreFill enabled).

           

          MktoForms2.whenReady(function(form){
            form.setValues({ "Referring Partner" : "{{Lead.Account ID (18)}}" });
          });
          
            • Re: Partner Referral Form and pURL
              Elliott Lowe

              Thanks!  The hidden field exists in the Form, but prefill won't work since Munckin will be disabled and the cookie archived since this is a referral form.   Should I remove the hidden field from the form when setting the value via the Forms 2.0 JS?

               

              Dumb question alert - if I dragged and dropped the form onto the LP, how do I edit the form JS?

                • Re: Partner Referral Form and pURL
                  Sanford Whiteman

                  Thanks! The hidden field exists in the Form, but prefill won't work since Munckin will be disabled and the cookie archived since this is a referral form.

                  Technically an existing cookie isn't necessary for PreFill (viz. mkt_tok) but yeah, with neither available you need to take a different tack.

                   

                  In the pURL context, you should still be able to set the default value of a field to your {{lead.token}}, another PreFill emulation.  Try that first for simplicity.

                   

                  Should I remove the hidden field from the form when setting the value via the Forms 2.0 JS?

                  Up to you, but if the field is not on the form, use form.addHiddenFields() instead of form.setValues().

                   

                  Dumb question alert - if I dragged and dropped the form onto the LP, how do I edit the form JS?

                  Add a separate HTML Element with <script>MktoForms2.whenReady(...)</script> in it.

                  1 of 1 people found this helpful