SOLVED

Help with Leads that are cookied that are bypassing our custom duplication rule

Go to solution
jsnow
Level 2

Hello all,

I am having an issue and was hoping someone here might have an idea or solution to resolve what we are running into. We have custom duplication rules in place where if a net new lead fills out a form with one company "mkto PortCo Most Recent" and then that same person fills out a different form for a different company, that it creates a duplicate lead rather than update the existing record. For example, if someone fills out a "Company X" form and then later fills out a "Company Y" form, it should create a lead for the person with both companies rather than update the company from "Company X" to "Company Y". 

We have a .js code that was supposed to help solve this issue. We had a member of our team place this on the back-end of a testing form/landing page. This .js clears the Mkto tracking cookie upon submission of the form, if the pixel was causing the issue a quick test of multiple submissions using the same email but different companies (mkto portco most recent) would create duplicates as per our custom deduplication rules, however I tested this on our test submission page that we use similar to how a tradeshow form would be used and it did not create a duplicate and instead updated the marketo record.  My expected result is that the marketo cookie would be cleared from the _mkt_trk hidden value and a duplicate would be created for the ‘mkto portco most recent’ submissions.

You can see that the form submission simply updated the mkto portco most recent rather than creating a duplicate


jsnow_0-1666626996896.png

This is the code we used and was placed on that test landing page.

 

<script>
//add a callback to the first ready form on the page
MktoForms2.whenReady( function(form){
               //add the tracking field to be submitted
        form.addHiddenFields({"_mkt_trk":""});
        //clear the value during the onSubmit event to prevent tracking association
               form.onSubmit( function(form){
                              form.vals({"_mkt_trk":""});
               })
})
</script>

 


Any help or suggestions that you can think of would be greatly appreciated! Please note that we tried testing the form with and without the .js code and got the same results both times of it not working.

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

Like I mentioned, I tried testing this with the code in the header and the place you suggested yesterday, and it still gave me the same result which was a failed test where it just updated mkto PortCo Most Recent field instead of creating a net new lead.

Well, if it’s in the <head>, the code throws an error instantly because the forms library doesn’t exist yet. So that’s not really a fair comparison. Only when the code is actually running in full can you decide whether it fills your needs or not.

 

It sounds to me like you need to remove the mkt_tok as well. Use this code instead:

MktoForms2.whenReady(function (form) {
   form.addHiddenFields({ 
      _mkt_trk: "",
      mkt_tok: ""
   });
   
   form.onSubmit(function (form) {
      form.vals({ 
         _mkt_trk: "",
         mkt_tok: ""
      });
   });
});

View solution in original post

13 REPLIES 13