SOLVED

Webhook response and lead association / merge

Go to solution
Yaron_Meiner
Level 2

Webhook response and lead association / merge

Hi all,

I am integrating Intercom with our systems. and i use webhooks to complete the data that SF gets from intercom by using a webhook and it works basically great buy one thing - Merging with the munchkin of the user.

Since the user is already traveling the site and using the chat in the site, it already has a munchkin id. I can send the munchkin id through intercom. What i am missing is how to map the munchkin id in a way that will merge the annonymous data with the current lead that was created by sf.

the sync looks like that website -> qualified lead in intercom -> sf -> marketo (by sf <-> marketo sync), webhook with email from intercom -> data is in marketo.

* Please avoid giving Zapier ideas, i do maintain my own api and trying to avoid the extra link in the chain.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Webhook response and lead association / merge

You can do this with a webhook in one of 2 ways:

  • Have the webhook loop back to Marketo and call the REST AssociateLead endpoint (seemingly most professional, but creates a possible DoS vuln because it consumes one API call for public events)
  • Have the webhook loop back to Marketo and POST to the Forms 1.0 /save or Forms 2.0 /save2 endpoint (more primitive in most senses, but leaves your REST API calls alone)

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Webhook response and lead association / merge

You can do this with a webhook in one of 2 ways:

  • Have the webhook loop back to Marketo and call the REST AssociateLead endpoint (seemingly most professional, but creates a possible DoS vuln because it consumes one API call for public events)
  • Have the webhook loop back to Marketo and POST to the Forms 1.0 /save or Forms 2.0 /save2 endpoint (more primitive in most senses, but leaves your REST API calls alone)
Yaron_Meiner
Level 2

Re: Webhook response and lead association / merge

I'm using a marketo webhook to draw the information from Intercom are you suggesting to trigger a webhook from marketo to marketo? possible race condition?

SanfordWhiteman
Level 10 - Community Moderator

Re: Webhook response and lead association / merge

No race at all. You trigger on Data Value Changes to the field you're using to transport the cookie. 

But you're not (at least on any of my instances) going to be able to hit the API directly (nor is this feasible with the REST API given the need to fetch a token from the /identity endpoint first) . You have to gateway it through your own external server and then back to Marketo.

Yaron_Meiner
Level 2

Re: Webhook response and lead association / merge

Yeah, that's what i am trying to avoid... if I would have written the babel fish here, I would have went with intercom -> api (with intercom event webhook and api call) -> marketo /save2 but its another piece of code to maintain and monitor. If i can find a way to associate/merge with a smart campaign it could be ideal.

SanfordWhiteman
Level 10 - Community Moderator

Re: Webhook response and lead association / merge

There is no other way to associate the cookie.

Yaron_Meiner
Level 2

Re: Webhook response and lead association / merge

The way i did it:

  • I added the munchkin token (_mkto_trk cookie) to every lead in intercom.
  • Lead is synced to sf and from there to marketo (takes about 10 minutes, since we already have bizdev in touch with the lead it is ok by us) - intercom deliveres - Name, email, company.
  • When lead arrives to marketo - webhook to intercom to complete all additional details  - country, state/province, ip, etc. in this call we also get the munchkin token.
  • With the stored munchkin token - second webhook to marketo itself - /save2 that includes  email & mkt_trk, (we created a dedicated form i named associate lead) - this associates the lead to the anonymous lead the user was in the beginning.

Zero code integration achieved (well, except for the embed and mapping of fields to intercom but that's local JS).

* Yes i did submit a form from marketo webhook to marketo save2 and it works, saves the need to authenticate.

What we are missing, is the ability to associate lead as a smart campaign, it could save a webhook, but it works.