SOLVED

How can you create an internal alert to notify marketer if a threshold is not met?

Go to solution
Ronn_Burner
Level 4

How can you create an internal alert to notify marketer if a threshold is not met?

I'm looking to create a program for internal use only that will essentially send me an "alert/notification" if a program does not meet a specific threshold (5 total emails sent) or surpasses a threshold (was sent more than 100 emails) on any given day.

 

Marketo isn't really designed with this functionality as it's based on individual records rather than the aggregate of programs or tasks. Obviously, I can subscribe to an Email or Program Performance Report set to daily and manually check the activity, however, the volume of emails would be overwhelming which I am trying to avoid. I'd like to be notified only in the event something is amiss.

 

The reason for this is we have two SalesForce orgs that go through a middleware into Marketo. Occasionally code "breaks" in the middleware resulting in either zero or hundreds of records qualifying for programs and receiving emails - which needs to be flagged within 1 day rather than weeks potentially.

 

What do you think is the best way to approach this?

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How can you create an internal alert to notify marketer if a threshold is not met?

You can generate the access token using the identity endpoint (you'd need to pass your custom API service's Client Id and Secret in the parameters). You'd need to authenticate all the REST API calls you make using a bearer access token, which is different from the paging token itself! Paging tokens are used to page through results or retrieve data updated relative to a given data.

 

You'd need to generate the paging token first based on the DateTime that you want to begin retrieving activities from and use it as a parameter in the Get Lead Activities API call. I hope this helps. Apologies if I misunderstood your question!

 

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: How can you create an internal alert to notify marketer if a threshold is not met?

It’s not feasible to trigger such an alert using the Marketo UI alone.

 

This is a “Dead Man’s Switch” type of situation where you’re trying to detect group inactivity.

 

While Marketo can detect inactivity on a single lead level, unless you’re sure that person was supposed to do something (i.e. a test lead that is forced into a process using an external service) that won’t help. And high activity isn’t detectable at all using that method, since by its nature it would be across many leads.

 

It’s feasible to build an app to do this using the Marketo REST API, periodically downloading activities of a certain type and detecting aberrations.

 

Ronn_Burner
Level 4

Re: How can you create an internal alert to notify marketer if a threshold is not met?

That's right. And confirmation there is no Marketo UI magic to execute this.

 


It’s feasible to build an app to do this using the Marketo REST API, periodically downloading activities of a certain type and detecting aberrations.


The known details are simple in theory. 

Less than 5 email sends (or email sends = 0 would also work if that's easier) for the aggregate to trigger an inactivity flag (email).

More than 50 emails sends to trigger a high activity flag (email).

 

Figuring out how to build the app using Marketo REST API to execute these flags is the part that is beyond my skillset. Would you be able to get me started or point me in the right direction? I have reviewed the https://developers.marketo.com/rest-api/ however even that appears to be specific to individual lead records.

 

 


SanfordWhiteman
Level 10 - Community Moderator

Re: How can you create an internal alert to notify marketer if a threshold is not met?


Figuring out how to build the app using Marketo REST API to execute these flags is the part that is beyond my skillset. Would you be able to get me started or point me in the right direction? I have reviewed the https://developers.marketo.com/rest-api/ however even that appears to be specific to individual lead records.



The REST API gives access not just to individual leads but to Activity Logs across the instance.

 

At a high level what you want to do is get all activities of a certain type since the last checkpoint (using a paging token, which is based on time). If you always change program status when someone is sent an email, then the best activity type would be Change Program Status, since that lets you filter by relevant Program IDs. Otherwise you’d have to use Sent Email, which is a far bigger result set to download, filter and count, though still feasible.

Ronn_Burner
Level 4

Re: How can you create an internal alert to notify marketer if a threshold is not met?

The goal of scanning the Email Sends every 24 hours that will send an email notification if/when the activity for any one of 20 programs has abnormally high or low activity.

I've inadvertently gone down a bit of the Developer's JSON rabbit hole trying to figure out the correct version to use for this goal.

If the access token only lasts 1 hour how and where is this executed? I assume the paging token serves as an automated mechanism creating a new access token every 24 hours but I'm not sure what JSON script I need to focus on. If so, is this all executed in a single JSON script?

 

Request
GET /rest/v1/activities/pagingtoken.json?sinceDatetime=2014-10-06T13:22:17-08:00

Response
{
    "requestId": "1607c#14884f3e74e",
    "success": true,
    "nextPageToken": "GIYDAOBNGEYS2MBWKQYDAORQGA5DAMBOGAYDAKZQGAYDALBQ"
}

Request
GET /rest/v1/activities.json?nextPageToken=GIYDAOBNGEYS2MBWKQYDAORQGA5DAMBOGAYDAKZQGAYDALBQ&activityTypeIds=1&activityTypeIds=12

 

Do I combine the Get Lead Activities JSON with the paging token script into a single script or are multiple steps required?

https://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#/Activi...

 

 

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How can you create an internal alert to notify marketer if a threshold is not met?

You can generate the access token using the identity endpoint (you'd need to pass your custom API service's Client Id and Secret in the parameters). You'd need to authenticate all the REST API calls you make using a bearer access token, which is different from the paging token itself! Paging tokens are used to page through results or retrieve data updated relative to a given data.

 

You'd need to generate the paging token first based on the DateTime that you want to begin retrieving activities from and use it as a parameter in the Get Lead Activities API call. I hope this helps. Apologies if I misunderstood your question!

 

SanfordWhiteman
Level 10 - Community Moderator

Re: How can you create an internal alert to notify marketer if a threshold is not met?

Everything Darshil said.