Syncing Anonymous Leads with SFDC Contacts

Anonymous
Not applicable
We're currently running associate_lead via the Munchkin API when a user signs up for our app and also creating an account in SF. This account gets synced to Marketo but does not merge with the lead that we created via the Munchkin API (even though they both have the same email). Does anyone have any good solutions for syncing leads created in SF with annonymous leads in Marketo? (so that we can retain web acticity from pre signup). Thanks!
Tags (1)
21 REPLIES 21
SanfordWhiteman
Level 10 - Community Moderator

Can you post the rest of that screenshot (including the generated webhook URL)?

Anonymous
Not applicable

Hi,

here it is:

pastedImage_0.png

what do you think? will we be able to get this to work?

SanfordWhiteman
Level 10 - Community Moderator

Looks right.  Still works on my test pod (app-sj01) but maybe it's finally been disabled on your pod as it is officially unsupported, as noted above.

Note that you don't need to use the loopback /save endpoint anyway.  You can just bounce off a remote webhook back into the /save2 endpoint. Thjs always works. 

(BTW your Munchkin ID is readable by the public, so there's no reason to obfuscate it here!)

Anonymous
Not applicable

Hi thanks for the advice. The guy above did so I did the same. (hide the id) thought it was private stuff

Sorry but What do you mean by "You can just bounce off a remote webhook back into the /save2 endpoint." ?

do you mean change the url to index.php/leadCapture/save2 ??

SanfordWhiteman
Level 10 - Community Moderator

Hi thanks for the advice. The guy above did so I did the same. (hide the id) thought it was private stuff

It's publicly readable on your website, so not really.

Sorry but What do you mean by "You can just bounce off a remote webhook back into the /save2 endpoint." ?

do you mean change the url to index.php/leadCapture/save2 ??

You can't connect directly to the /save2 endpoint from behind the Marketo firewall.  This is a network-related restriction that unfortunately impacts what you're trying to do here (and which hitting /save via localhost used to work around).

But there's no problem calling out to a remote webhook that in turn calls back in (like any other remote connection).  For example, switch to the demo endpoint I just put up at http://app-ab14.marketo.com.formloop.teknkl.com/index.php/leadCapture/save2

Note that any such method is a server-side form post and as such as restricted to 30 posts per second, if that is something that concerns you.  Really the better approach is to make sure that leads are created in Marketo directly, so you don't have to worry about this.  I've seen many people go down the wrong road with SFDC-integrated or standalone forms and get into exactly the same mess.

Anonymous
Not applicable

thank you very much for your time with me. I tried your solution using zapier webhooks it's giving me "returned (400) 1 and said "{leadCapture/save2} Approved form not found: " error now

SanfordWhiteman
Level 10 - Community Moderator

I can't comment on how you've set up your Zap -- you may have miscapitalized a field -- but you can see it works with the endpoint I provided.

Anonymous
Not applicable

Hi sanford, your answer here ​resolved the issue. I was passing the variable as "formid" instead of "formVid"

SanfordWhiteman
Level 10 - Community Moderator

OK, please mark as the Correct Answer.  Also note that you should be passing formid and formVid when emulating a form post, within the current API.  Set them to the same value.

Anonymous
Not applicable

tried it anyways, gave me "operation timeout" this time

pastedImage_1.png

Anonymous
Not applicable

This solution looked very simple and gave this a try, however, it does not work for me. I'm getting... "HTTP Error 404: URL not found."

pastedImage_2.png

help?

Jep_Castelein2
Level 10
Yes, that is correct. If you have a hidden form field _mkt_trk and the Munchkin on the page, it should automatically put the Cookie ID in that hidden field. I'm not sure if you can easily do that with a SFDC web-to-lead form (or whichever form you're using). If not, you can always use custom JavaScript to read the cookie and save it in a hidden field. 

Localhost URL works on my Pod and should in principle work on all Pods (haven't tested it on all Pods though). 

By the way: the response to the webhook call is a 302 error code. That's not really an error: it's just a redirect, which the webhook can't follow. It does actually work: you will be able to see the web page visits in the Lead record now. 
Mark_Rentschle3
Level 2
Thanks for responding.

Ok, so the comment from support "you
 would need to have a method of capturing and storing the Cookie Id in a custom field" is valid (i.e. I will need to figure out a way to do that outside of the Marketo UI). Correct?

Otherwise, the webhook will work, including the localhost URL? 
Jep_Castelein2
Level 10
It still works for me. I don't think this has ever been officially supported, but it definitely works for me. I can't guarantee it will work on all pods (I'm on app-sjf, for what it's worth).

Below is a screenshot of my webhook.I created a custom field "Marketo Cookie ID" in SFDC. It's up to you to populate that with the correct Cookie ID. My Smart Campaign is as follows: 
  • Smart List
    • Trigger: data value changes, field is "Marketo Cookie ID", new value is not blank
    • Trigger: lead is created, source = salesforce.com
    • Marketo Cookie ID is not empty
  • Flow
    • Call Webhook "Associate Cookie ID"
  • Schedule
    • Run every time
0EM50000000SwOR.jpg
Mark_Rentschle3
Level 2
FYI this solution is no longer supported. Here is the response I got from Marketo support:

That document is no longer valid. You can not trigger on the Marketo Cookie, there is also not a token for the cookie. You would need to have a method of capturing and storing the Cookie Id in a custom field. 

The server side forms post is also dated and localhost is not available. I apologize but that document is misleading. 
Mark_Rentschle3
Level 2
Jep, thank you for sharing this solution. I'm stuck on a couple parts and hoping you can provide a bit more detail:
  1. I am unable to access the attribute 'Marketo Cookie ID' in my smart campaign trigger. Is that just a place holder for the _mkt_trk field name? Or another value?
  2. Same question regarding the webhook, should the token actually be {{lead.Marketo Cookie ID}} or something else?
  3. Should the URL in the webhook be what it is in the screenshot, or something else?
Thanks!
Jep_Castelein2
Level 10
Yes, you can do that, but you will have a significant drop-off, because a lot of people won't click the email. Also, if people don't "confirm" their email, will you still send them emails? 
Anonymous
Not applicable
Ah ok that makes sense, thanks a lot. Would sending the lead a 'confirm your email' with a link to a Marketo landing page also accomplish this? Or once the lead is created in SFDC and synced down to Marketo this is the only way to sync?
Jep_Castelein2
Level 10
First part is correct. The Munchkin code on the sign-up page generates a unique Cookie ID, which you save in a custom field in SFDC (as part of the form submission). This custom field syncs to Marketo, so you now have the Cookie ID in Marketo. However, it's just stored in a field, it's not actually associating the anonymous lead record to the known record yet. That's where the Webhook comes in. The webhook fills out a Marketo form on your own Marketo instance and passes in the Cookie ID. This will merge the anonymous lead records into the known lead record. Does that clarify?  
Anonymous
Not applicable
Thanks a lot for sharing this, I looked it over but still not 100% sure how it works with SFDC. Is this workflow correct?

When the user signs up and I creat the lead in SFDC (email, name, company, etc) I also upload the Cookie ID. I then match that field to a custom field in Marketo. Then I'll be able to create a webhook and smartlist to sync the lead I created in SFDC with the annonymous lead that already existed in Marketo?