Help with Leads that are cookied that are bypassing our custom duplication rule | Community
Skip to main content
New Participant
October 24, 2022
Solved

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

  • October 24, 2022
  • 1 reply
  • 4079 views

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




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.

Best answer by SanfordWhiteman

Just as a follow-up to this, these are the steps I took to do the test. Is it possibly an issue with one of the steps in our test or do you think it's something in the code? 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. See below:

Set new marketo cookie:

1. Clear your cookies on your browser
2. Go to autoshop solutions and navigate to multiple pages (ie. 3 separate pages)
3. Navigate to the Schedule a Demo form
4. Fill out the form with a valid email that you have access to and submit
5. Check MKTO and Salesforce to ensure lead came in, in Salesforce ensure that the page data shows on Marketo Sales Insights


Create 360P test email:

1. Create a test email send that includes a link to this test page (staging-t360payments.kinsta.cloud/partner-with-us/mkto-form-test/) and ensure this has all the link tracking enabled
2. Add the test lead you created in “Set new marketo cookie” testing section to the list for the test send
3. Send the email to the valid email you submitted in the “set new marketo cookie” section
4. Once the email is received click on the 360P link
5. Fill out the form on the 360P test page using the same data from your test lead in “set new marketo cookie” section
6. Verify that the lead submitted on the 360P test page created a net new lead for 360P

Expected result is that a net new lead for 360P will be created. A failed test is if the 360P test lead merged with the ASi lead created in “set new marketo cookie” section.



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: "" }); }); });

1 reply

SanfordWhiteman
New Participant
October 24, 2022

Can you link to the page with this code to make sure it was deployed correctly?

jsnowAuthor
New Participant
October 24, 2022

Are you asking for the url of the landing page with the test form on it? If so, here you go: 
staging-t360payments.kinsta.cloud/partner-with-us/mkto-form-test/

SanfordWhiteman
New Participant
October 24, 2022

 

Line 84:

 

You’d kind of hope your developers would’ve noticed this. 😐

 

P.S. The comment “add a callback to the first ready form” is incorrect, the whenReady callback fires for all forms unless you deliberately check if it’s already fired (don’t know why you’d do this).