Cohort Notifications

With User (and Company) Notifications, you can receive notifications when customers match specific behaviors. This might include scenarios such as when a user has made their first API call or when a user hasn’t sent any traffic through your APIs after X number of days.

The User and company notification capabilities are all driven through a saved cohort. Moesif will send customer notifications specifying which users (or companies) were added and removed to a saved behavioral cohort that you created. A saved cohort is a dynamic list of customers that match your specific criteria. An example behavioral cohort would be New users who made their first API call today which would create a group, or cohort, of users that are new to the platform and sent their first API call through in the last day.

Saved cohorts drive a massive amount of functionality within Moesif. Here are a few example use cases of how cohorts can be used:

  • Trigger marketing automation workflows such as when a customer makes their first API call.
  • Receive Slack notifications on struggling customers with issues and proactively reach out.
  • Get email update when customers stop sending traffic

Alert Rules vs Cohort Notifications

For background, Moesif has two different notification systems that can be used for different use cases. This page is focused on User Notifications.

The differences between the two are described below:

  • User Notifications will send a list of users (or companies) that match your specific behavior such as customers who made their first API call. There are no metrics involved, rather the notification is a list of customers.
  • Alert Rules monitor a time-series metric such as average latency or request volume in real-time and alerts you when the metric deviates from what you expect. The alert can be triggered when the metric passes a static threshold or when Moesif detects an anomaly. Alert rules can also be multi-dimensional which allows you to track metrics on a per customer level.
Name Type Primary User Use Case Example Metrics Frequency
User Notifications User behavior centric Marketing & Customer Success Receive notifications on customers who exhibit certain behaviors Whenever customer added to a cohort (sent as a batch)  
Alert Rules Time-series centric Product & Engineering Receive alerts when a metric has abnormal behavior or passes a threshold Real-time or specific intervals  

How to Set Up Cohort Notifications

1. Create a Saved Cohort

In the left sidebar menu, chose Users or Companies. In the User/Company Lookup screen, set the filters to match the criteria of the target customers you’re interested in. For example, if you’re interested in receiving notifications when customers made their first API Call today, but they also saw 400 errors, we would add the following filter criteria:

Users who’s first_seen_time is today and Who performed an API Call where response status is 400

Users who made first API Call and 400 error

To create the cohort, click the Create Cohort button in the top right. In the modal that appears you will give a name to the cohort in the Cohort Name field and verify the filter set is correct. Once complete, click the Create Cohort button in the bottom right of the modal to create the cohort. Once created, you’ll be able to use this cohort to drive notifications.

For more instructions on creating saved cohorts, check out the saved cohorts documentation.

2. Create the Cohort Notification

When a new cohort is created, you will be brought to the saved cohort page. A modal will appear that allows you to easily add automated flows built on top of the saved cohort, including cohort notifications. To add a cohort notification from here, click on the __Notification/Webhook link.

Add User Notification Through New Cohort Modal

Alternatively, if the cohort is already created, you can access it by going to the User/Company Cohorts menu item, underneath Users/Companies in the left-side menu. After selecting the cohort, on the Cohort Details screen, you’ll click the edit/pencil icon beside the Notifications entry in the Cohort Info located on the right side of the screen.

Add User Notification

In the Set Up User Cohort Notification modal that appears, fill out the fields based on your needs for this specific notification.

Set Up User Cohort Notification Modal

The fields to fill in/select include:

  • Send to - This is the channel(s) that the alert will be sent to when it fires. Currently, Webhooks, Slack_, and Email are supported channels. See Adding a channel below for details on adding a new channel.
  • Send when - This can be set to specify when the alert should fire. Possible values to select include User Joins Cohort, User Leaves Cohort, or Both.
  • Includes custom fields when joining - This setting allows you to add fields to the data that gets sent in the alert when a user joins the cohort.

At the bottom of the modal you can specify the frequency that the notification will get sent sent. By checking off Once Only, all alerts within 5 minutes will be aggregated into a single notification. This can help to keep the noise down from multiple notifications spamming the selected channel.

You’ll also be able to create a resend interval by selecting the User eligible for resend checkbox and specifying a time interval.

Once the fields are filled out, click Save in the bottom-right corner of the modal.

Adding a Channel

In the Send to field in the Set Up User Cohort Notification modal you can select a channel to send notifications to. To add a new channel, in the Send to field, select the New channel… option in the dropdown.

Add User Notification

In the Create Notification Channel modal that appears, you can create a new channel to send notification to.Currently, Webhooks, Slack, and Email are supported channels that can be added. In the modal, you’ll need to fill out the following fields:

  • Channel name - the name of the channel you are adding
  • Channel type - the channel you’d like to send it to (email/Slack/webhook)
  • Email Address/Slack Webhook URL/Webhook URL - the email address or webhook URL
  • Method (if Webhook is selected) - specify whether the webhook request will be a POST or PUT
  • Notification Throttle - used to set throttling on the notifications to make sure notification don’t get too noisy

Receiving Notifications

You’ll receive notifications as customers are added or removed from your cohort based on their behavior. To avoid sending too many notifications, this will happen in batches (usually within 15 to 30 minutes).