No-code Jitsu: Flexible Slack Notifications

Sergey Buryking

Software Engineer
July 5th, 2021

Recently we've released WebHook destination. It is a powerful feature that allows Jitsu to send events into a variety of services including Slack. Slack notifications are suitable for staying up-to-date with significant events such as new user signups, payment plan updates, errors, and others. We're big fans of dog-fooding and we use Jitsu for our jitsu.com and Jitsu.Cloud. Every time a user signs up or changes their subscription plan we put a notification into a Slack-channel. Notifications about frontend errors go to the same channel as well.

Stay up-to-date with new signups

On the early company stage every user signup is important. Once a user signs up, a customer success manager (or even a founder!) might want to take a look at user actions and settings (via logs) and make sure that the new customer experience is as smooth as possible.

We receive Slack notifications about new customer signups on Jitsu.Cloud. Jitsu can include the source of an advertising campaign, and location geo data with customer city as in the example below:

User has been signed up to notification
User has been signed up to notification

React to significant events

Another use-case is getting notifications within the app about significant events that have happened. Example: the customer just upgraded their payment plan. At Jitsu we get notifications about plan upgrade and changes in sources/destinations configuration.

Error notification errors

While dedicated monitoring tools (such as Sentry) are better suited for advanced monitoring, Jitsu can do the basic error notification just as well. Once an error occurs the first time, we are immediately notified with the error description (stack trace context) along with all relevant details.

Configuration

See the detailed configuration we used below.

Slack App Configuration

Slack uses apps for accepting incoming requests and sending notifications to a certain channel. Configure Slack app with the following steps:

  1. Open Slack Apps page
  2. Create New App -> From scratch -> Select a clear name and Workspace
  1. Application page is opened. Go to Features -> Incoming Webhooks menu -> Switch ON "Activate Incoming Webhooks" toggle
  1. Click on "Add New Webhook to Workspace" in the bottom of the page
  1. Select Slack channel for notifications and click "Allow"
  1. Copy Webhook URL and use it on Jitsu WebHook destination configuration page

Jitsu Destination Configuration

WebHook destination can build requests on the fly with dynamic structure based on input events. Configure Slack integration with the following steps:

  • Make sure you've added Jitsu JS tracking pixel and jitsu.track('{event_type}', {...event data}) (where event_type might be registration, conversion, etc) tracking code on your website.
  • Open Jitsu.Cloud or Jitsu self-hosted configurator UI
  • Go to the Destinations page -> click Add Destination and select WebHook
  • Put Slack Webhook URL from Slack App Configuration section into HTTP URL field, HTTP method - POST
  • Use Table Name field as a filter if you would like to send only registration events:
{{if eq .event_type "registration"}}send{{else}}{{end}}
  • Fill HTTP JSON Body with your Slack notification template. It is a structured JSON with GO text/template placeholders. For instance: {{.event_type}} extracts event_type field value from event JSON. Check notification syntax on Slack page:
{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "🤘 {{.event_type}} from {{.user.email}}",
        "emoji": true
      }
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "User {{.user.email}} has sent *{{.event_type}}*"
      }
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Data*:```{{ json_indent_quote . }}```"
      }
    }
  ]
}
  • Get Jitsu notifications in your Slack!

Learning More

  • Follow & star Jitsu on GitHub
  • Try a cloud version of Jitsu. It's free for up to 250,000 events per month
  • Join our Slack! Our community will help you with any questions!

About Jitsu

Jitsu is an open-source data integration platform offering features like pulling data from APIs, streaming event-base data to DBs, multiplexing and many others.
© Jitsu Labs, Inc

2261 Market Street #4109
San Francisco, CA 94114