Re: Bypass Marketo dedupe rules to create new leads every time

Natali_Talevski
Level 4

Bypass Marketo dedupe rules to create new leads every time

Hi,

Is it possible to have Marketo create a new lead every time a form is submitted rather than dedupe? For example, if j.smith@email.com submitted the form twice, it would create a new lead twice rather than update the existing lead? We only need this to happen for one particular form and not every form. Marketo have said its possible to do via this API call http://developers.marketo.com/rest-api/lead-database/, but has anyone done it another way?

Thanks

Natali

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Bypass Marketo dedupe rules to create new leads every time

I'm unhappy that the API was officially suggested here. That's a truly awful idea.

It's actually extremely simple to do, as long as you're positive that your database filling with duplicate email addresses is what you want.

Use another visible field on the form in place of Email Address, call it Proxy Email in this case.  Have the Email Address be a random hidden field. Then in a flow, Change Data Value Email Address → {{lead.Proxy Email}}.

On the page with the form, have this JS:

MktoForms2.whenReady(function(form)

  form.onSubmit(function(form){

    var currentValues = form.getValues();

    form.addHiddenFields({

      Email : currentValues.ProxyEmail + Math.random()

    });

  });

});

Natali_Talevski
Level 4

Re: Bypass Marketo dedupe rules to create new leads every time

So I've been testing this, and it only works if cookies are completely cleared from the page. Also, the hidden email field isn't needed as the change data flow will update the field. I've made it so the page is not tracking or leaving cookies, and used the same proxy email field in the form with the change step in the trigger. That seems to work

SanfordWhiteman
Level 10 - Community Moderator

Re: Bypass Marketo dedupe rules to create new leads every time

So I've been testing this, and it only works if cookies are completely cleared from the page.

No, it works perfectly fine as described (aside from a missing curly brace in my code, which you presumably adjusted as there's a syntax error otherwise).

You must not have implemented it correctly, which is why you saw the cookie-related behavior.

Also, the hidden email field isn't needed as the change data flow will update the field

It absolutely is needed. The Email field is mandatory so Marketo will create a new unique lead record regardless of there being an associated cookie. That's the key to the whole thing.

If you don't have the Email field on a form at all (not a proxy field, the system field literally named Email) you will continually reuse the same lead record in Marketo. That's well-known behavior and exactly what you need to work around. By having the Email field present in every form submission, but always guaranteed unique, a new record will be created each time.  Then on the server side, you copy the user-entered proxy email field over the system Email field, so all leads end up with the same active Email field value.

And you need to have Munchkin enabled or you won't log anyone's actions (including the last person who filled out the form). That doesn't make sense from a usability standpoint.

Here are four leads created in succession from the same form with the same visible data:

pastedImage_9.png

pastedImage_10.png

In this case I have left the Email field as is-is to show you how it works directly after form submission.

Then I add the SC + Flow step as described:

pastedImage_13.png

pastedImage_12.png

Then fill out the field 4 more times and search the db again:

pastedImage_14.png

4 unique leads with the same Email.

Munchkin is enabled as normal for the form, and you can see Visit Web Page activities for the currently associated lead:

pastedImage_16.png

Natali_Talevski
Level 4

Re: Bypass Marketo dedupe rules to create new leads every time

So no matter what I do, this does not work. It continually updates the original record. Are you using 2.0 forms and responsive pages?

SanfordWhiteman
Level 10 - Community Moderator

Re: Bypass Marketo dedupe rules to create new leads every time

Are you using 2.0 forms

Of course.

and responsive pages?

You mean a Guided LP? The above is a form embed on an otherwise blank HTML page. It'll work the same on any page.

Chances are the script isn't even running on your page (can't tell since I don't have your URL). When adding custom form behaviors to a Guided LP you must add the <script> just before the closing </body>. Otherwise there'll be a reference error, which you can see in your browser's F12 Console.