Slack is a popular business communication platform that lets you organize all your business-related chats by specific topics, groups, or direct messaging.
Find the open source transformer code for this destination in the GitHub repository.
Once you have confirmed that the source platform supports sending events to Slack, follow these steps:
From your RudderStack dashboard, add a source. Then, from the list of destinations, select Slack.
Assign a name to the destination and click Continue.
Connection settings
To successfully configure Slack as a destination, you will need to configure the following settings:
Event channel settings
Use the following settings to send an event to a particular Slack channel:
Setting
Description
Type of incoming webhooks
Select the API from the dropdown that RudderStack uses to send data to the particular Slack channel:
Setting
Description
Legacy
RudderStack maps the channel based on the Event Channel Name setting. This method may be deprecated soon.
Modern (through app)
RudderStack maps the channel based on the Event Channel Webhook setting.
Event Name
Enter the event name or regex to match the RudderStack event name. For example, the regex ^slack\.events\.[a-zA-Z_]+$ matches strings like:
slack.events.message
slack.events.reaction_added
slack.events.user_typing
If an event matches a regex, then RudderStack uses the corresponding Event Channel Webhook and Event Template (if specified).
Event Channel Webhook
Enter the webhook URL of the Slack channel where RudderStack sends the above event. This is a required field if you have set Type of incoming webhooks setting to Modern.
Note: To get the URL for Event Channel Webhook setting, make sure to:
Create a Slack app with the Incoming Webhooks feature.
Authorize the app to post to your specified Slack channel.
See the FAQ section for more information on obtaining this URL.
Other settings
Setting
Description
Allowlisted Traits
Specify the user traits you want to allowlist.
Note: If not specified, RudderStack sends all the user traits to Slack.
Denylisted Events
Enter the events to add to your denylist, causing RudderStack to drop these events.
Consent management settings
Configure the consent management settings for the specified source by choosing the Consent management provider from the dropdown and entering the relevant consent category IDs.
New Order Alert!{{newline}}{{newline}}Customer: {{name}}{{newline}}Event: {{event}}{{newline}}Amount: ${{properties.revenue}}{{newline}}Items: {{properties.item_count}}
Corresponding Slack message
New Order Alert!
Customer: Alex Keener
Event: Order Completed
Amount: $100
Items: 2
Escaped content
The values returned by {{variable}} are HTML-escaped.
For example, if a variable has a & in its value, then it will be returned as &. To avoid this behavior, you can use the triple curly braces instead of double braces, like {{{variable}}} instead of {{variable}}—this will stop the handlebars from escaping a value if there is one. See the following example:
Expression
Variable
Result
{{variable}}
"Marcia & Jan"
"Marcia & Jan"
{{{variable}}}
"Marcia & Jan"
"Marcia & Jan"
Identify
The identify call lets you identify a visiting user and associate them to their actions. It also lets you record the traits about them like their name, email address, etc.
End-to-end example
The following is an end-to-end example of how a identify call translates to a Slack message depending on your dashboard settings:
rudderanalytics.identify("1hKOmRA4GRlm",{name:"Alex Keener",email:"alex@example.com",plan:"Premium",// This won't appear since it's not allowlisted
city:"San Francisco",country:"USA",phone:"+1234567890"// This won't appear since it's not allowlisted
});
You will see the following message in your configured Slack channel:
Welcome Alex Keener!
Email: alex@example.com
Location: San Francisco, USA
Track
The track call lets you record the user events, that is, the actions your users perform, along with any properties associated with these actions.
End-to-end example
The following is an end-to-end example of how a track call translates to a Slack message depending on your dashboard settings:
rudderanalytics.identify("1hKOmRA4GRlm",{name:"Alex Keener",email:"alex@example.com",plan:"Premium",// This won't appear since it's not allowlisted
city:"San Francisco",country:"USA",phone:"+1234567890"// This won't appear since it's not allowlisted
});
And then, you send a track call as follows:
rudderanalytics.track("Product Purchased",{product_name:"Wireless Headphones",price:149.99,order_id:"ORD-2025-619",quantity:1,category:"Electronics"// This will be available as {{properties.category}}
});
You will see the following message in your configured Slack channel:
Alex Keener just bought something!
Product: Wireless Headphones
Price: $149.99
Order ID: ORD-2025-619
Quantity: 1
Category: Electronics
FAQ
How do I obtain the incoming webhook URL?
To obtain the webhook URL, follow the below steps:
Click your Slack workspace name, then go to Administration > Manage Apps.
Search for Incoming webhooks in the Slack app directory and add it to Slack by clicking on Add to Slack.
Select a channel where you want to post the messages forwarded by the webhook and click Add Incoming webhooks integration.
Finally, copy the webhook URL and enter it in the RudderStack dashboard.
Why am I getting Slack messages for all the incoming events in one channel?
By default, RudderStack sends all the events to the Slack channel associated with the incoming webhook URL (Webhook URL setting in the RudderStack dashboard).
To get specific events in a particular channel, make sure you specify the mappings using the Event Name and Event Channel settings.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.