AnsweredAssumed Answered

AssociateLead function help

Question asked by Devin Poehlman on Jun 26, 2019
Latest reply on Jun 26, 2019 by Sanford Whiteman

We have some landing pages on Unbounce that we need to keep on Unbounce but we want to connect those new leads with their anonymous web behavior.  I'm trying to get the associatelead function to work but having trouble.  I'm passing the form values in the URL to the thank you page.  This is the code on the thank you page.

 

<script>
jQuery(window).on('load', function() {
  Munchkin.munchkinFunction(
    'associateLead',
    {     
      FirstName: <?php echo 'decodeURIComponent("'. rawurlencode($_REQUEST["firstName"]) . '")'?>,
      LastName: <?php echo 'decodeURIComponent("'. rawurlencode($_REQUEST["lastName"]) . '")'?>,
      Email: <?php echo 'decodeURIComponent("'. rawurlencode($_REQUEST["email"]) . '")'?>
    },
    '<?php echo hash('sha1', '*[Your Marketo Secret]*' . $_REQUEST["email"]; ?>'
  );
});
</script>

 

 

And this is how is it rendering on the page load:

 

 

<script>


jQuery(window).on('load', function() {

Munchkin.munchkinFunction(

'associateLead',

{

Email: decodeURIComponent("associate4%40test.com") FirstName: decodeURIComponent("Devin"),

LastName: decodeURIComponent("Poehlman"),

},

'564ee5a897297b0460926ea44af5e3312a4a800e'

);

});

</script>

What am I doing wrong?  I double-checked the field names and secret key.  

Outcomes