Re: Event name in Webhooks

Zachery_Miranda
Level 1

I would like to make a single webhook to be able to handle all events from Marketo regardless of which smart campaign the webhook is attached to. Is it possible to be able to know what triggered the webhook such as a specific event? I wasn't able to find a generic token to be able to do that in the payload. Is the only solution to make a webhook for every single event that we want to track?

13 REPLIES 13
Zachery_Miranda
Level 1

Thanks for the quick responses! I have one more question. What exactly would an event mean in Marketo (such as "email opened" or "email sent", etc.) and how many would be associated with a campaign?

Mark_Price
Level 7

oh! I also thought you meant events as in live events vs. an event tracker.   

As Sanford mentions, these are called activities in Marketo.  

Unless your volume is extremely low, I would not recommend a webhook for this purpose either. 

In my current instance we get this data with the Bulk Extract API: 

https://developers.marketo.com/rest-api/bulk-extract/ 

If you inspect the activity log of a record and click into an activity, you will get an idea of the data points you'll have. 

Zachery_Miranda
Level 1

Why is it that you wouldn't recommend using webhooks unless volume is really low? Do you worry that it would overwhelm my service or do the webhooks break down?

SanfordWhiteman
Level 10 - Community Moderator

We use webhooks profusely, millions of times a day across instances. So they are business-critical (our products depend on them) and awesome.

However, there are certain practicalities. One is the speed of light. Another is the number of webhooks Marketo will allow to be open simultaneously.  Another is the response time of your webhook-compatible service.

Together, these mean that, since Marketo will allow you to send millions of emails per day, triggering on Send Email is a danger zone. Webhooks top out at ~100K/day due to the practical considerations above.

Amy_Goldfine
Level 10 - Champion Alumni

Even if you don't hit Marketo's actual daily limit, you'll likely slow your instance to a crawl. At my last company, we were trying to use a webhook to get email activity into a Redshift database using some Heap Analytics webhooks. Every time we sent a big email, the webhooks would take up all of the available processing power in our Marketo instance and it would delay other critical actions such as processing form fills, webinar registrations, etc. Don't do it.

Amy Goldfine
Marketo Champion & Adobe Community Advisor
SanfordWhiteman
Level 10 - Community Moderator

There is no daily limit other than what the instance will bear under concurrent load.

So triggering on every send isn't the problem exactly -- it's that daily sends are not *themselves* metered. So every send on a slow day is fine, on a high-volume day it could be catastrophic. You can also set your webhook service to disable the trigger (using the Webhook is Called trigger to in turn call the REST API) when you go over a certain # of daily calls.

Zachery_Miranda
Level 1

Thanks! Good to know. I'm working on a product similar to Heap's webhook for our customers (hence why I'm not very familiar with Marketo). It's good information to hear that this approach is not recommended for our customers. We probably just will not support Marketo activities in the near future.

From this integration (and another one I've worked on), Marketo really needs to improve their infrastructure. I'm not sure who to tell this to.

Zachery_Miranda
Level 1

If you send on one webhook to a service with a response time of 50ms, would you say that it would still only be around 100K/day?

SanfordWhiteman
Level 10 - Community Moderator

Oh, you mean "event" as in "activity."

In Marketo, "event" specifically refers a type of program, and its associated live/virtual, er, event.

You can use the {{trigger.tokens}} for activities, they're built-in: {{trigger.trigger name}} is the type and {{trigger.name}} is the description/subject.

However, I hope you're not expecting to ping a service via webhook when an Email Sent activity occurs unless your daily volume is in the 10s of thousands only.

Zachery_Miranda
Level 1

When I try to set up a webhook on the webhook and insert a token, I don't see any of the trigger.tokens in the dropdown. Is there something I have to do to enable that?

Thanks!

SanfordWhiteman
Level 10 - Community Moderator

Just type them manually.

Mark_Price
Level 7

Hi, 

If you were to make a program token called {{my.eventTracker}} and then add that to your webhook when setting it up- I believe it will do what you would like. 

If the campaigns aren't nested in programs a folder token could potentially work.  

hope it helps!

SanfordWhiteman
Level 10 - Community Moderator

You could use tokens like {{campaign.name}}, {{campaign.id}}, {{program.id]}, etc.