How to setup the Slack webhook

Last updated:

|Edit this page

You can receive messages in Slack whenever your actions trigger.

Note: Currently it's only possible to receive messages in a single Slack channel. If you'd like to receive messages in more than one channel, you can use the Zapier integration.

1. Create an app in Slack

Go to the Slack developer dashboard and create a new app. Call it "PostHog" and connect it to the workspace of your choice.

Optional: Feel free to use an image from here as the app's logo.

image

2. Create a webhook in Slack

Go to the 'Incoming Webhooks' page for your newly-created app and toggle 'Activate Incoming Webhooks' to turn it on. Then click on 'Add New Webhook to Workspace' and select the channel that the action posts to.

image

3. Connect your webhook to PostHog

Copy the Webhook URL from Slack, navigate to project settings in PostHog, and paste the URL into the "Webhook integration section".

Add webhook integration

Click "Test & Save" and you should receive a message on Slack.

Note: In your project settings, you'll also see a "Slack integration" section. You can ignore this as this is not required for setting up the Slack webhook. It's only required for setting up Subscriptions to receive regular reports for any insight or dashboard.

Screenshot of Slack integration

4. Post actions to the webhook

In PostHog, navigate to the action that you'd like to receive webhooks for. Then select "Post to webhook when this action is triggered". You can also modify the message format.

PostHog Edit Action

5. Celebrate!

Slack Message

Questions?

  • Alex
    8 months ago

    Action events are captured but Slack Webhook is not being triggered

    Although it seems all action events are being recorded properly and the slack intregation works correctly because I see the message "Greetings from PostHog!" the Webhook is not triggered when an action event is captured.

  • Eli
    9 months ago

    Can I post to multiple slack channels?

    I'd like to send specific type of events to one channel a other type of events to another. how can we do it?

    • Ady
      9 months ago

      Hi Eli, you can only post to one Slack channel at the moment, but you could try doing this via Zapier instead?

    • Cory
      9 months agoSolution

      Realtime destinations (in public beta) now allows you configure multiple Slack messages! 🎉

  • Ron
    a year ago

    Connection with Slack doesn't work

    II have already connected to Slack and I have seen PostHog greetings there. However, when I tried to subscribe to a dashboard, I received the message that PostHog is not connected to the channel.

    Has anyone else faced this?

    • Artem
      9 months ago

      Sure!

  • Yev
    a year ago

    Posthog app is not longer approved by Slack

    Seems like a week ago the Posthog app is no longer approved by Slack. This means by subscriptions stopped working. Is this being fixed?

  • Anmol
    a year ago

    Action isn't getting forwarded to webhook

    Hi,

    I followed this Wiki and set up the webhook just fine as the test works alright. I checked the setting on the action to forward it to the webhook but that doesn't seem to be happening, I can see events captured correctly in my actions but they just don't seem to get forwarded to my webhook.

    How can I debug this?

    • Oliver(he/him)
      10 months ago

      Hey folks, definitely agree the current state of webhooks isn't where it should be. We're currently focused on shipping a totally revamped experience here, which should address the issues you're facing.

Was this page useful?

Next article

How to setup the Discord webhook

You can send messages to Discord whenever an action triggers. 1. Create an incoming webhook in Discord Navigate to the channel where you want to add the webhook and select the 'Edit Channel' option from left navigation pane. Select the 'Integrations' option from the left navigation pane. If you are creating a webhook for the first time, click the "Create Webhook" button. If you have other webhooks, click "View Webhooks" and then "New Webhook". Give the webhook a name. Select the channel…

Read next article