AnsweredAssumed Answered

Javascript API - associateLead

Question asked by a32a163ae7b8ed3f1d697bc5ac940fc73bb89f4b on Dec 5, 2013
Latest reply on Dec 6, 2013 by a32a163ae7b8ed3f1d697bc5ac940fc73bb89f4b
I'm stuck and could use some help.  I've gone through the documentation over and over to try to figure out how to implement the associateLead function.  One of the problems is trying to determine if the code is working properly.  Does any know of a way to do this?  Also, is the code structured properly?

The munchkin already sits on the page.  

The code I'm using is below.  I understand that the apikey should be done on the server and it will.  For now I'm just trying to get this to work.  I know all the variables are loading correctly.  I also know that the hash is being created.  It's the rest of the call I'm not sure about....

     <script type="text/javascript">
     <script src=""></script>
         function MarketoUpdate() {
             var email = "[user:email]".toLowerCase();
             var FirstName = "[user:FirstName]";
             var LastName = "[user:LastName]";
             var key = "myapikey";
             var hash = CryptoJS.SHA1(key.concat(email));
             mktoMunchkinFunction('associateLead', {
                 Email: 'email',
                 FirstName: 'FirstName',
                 LastName: 'LastName'
             }, 'hash');