Introduction
Slack is an all-purpose communication platform and collaboration hub. It includes instant messaging, voice and video calls, and a suite of tools to help groups share information and work together.
MoEngage <> Slack
The MoEngage and Slack integration can help you get timely updates about events captured by MoEngage directly inside Slack. You can also import users that join your Slack Workspace to MoEngage. This integration is powered by Zapier Actions, using which you can also create different cohorts (segments) for different channels to engage each of your channel members separately. With this integration, you can -
- Use MoEngage as a Trigger
- Create or update Slack contacts in MoEngage
- Add or remove Slack members to custom segments in MoEngage
- Import Events in MoEngage
Use Cases
- Send a Slack message when an event triggers on MoEngage.
- When a new member joins your Slack Workspace for the first time, create a new user in MoEngage.
- When a new mention (for example, support team) is sent on a public channel, add a new event in MoEngage.
- When a new reaction is added to your message, add the user to a cohort in MoEngage.
Integration
library_add_check |
Prerequisites
|
Send a Slack message when an event occurs in MoEngage
The use case takes advantage of MoEngage Connector Campaigns. For this tutorial, we will pick up Use Case #1: Post Slack message for each uninstall in MoEngage. On your Zapier Dashboard, and click on "+ Create Zap" on the top-left corner.
Step 1: Select Webhook by Zapier as the Trigger App
For the trigger, type "Webhook by Zapier" and select it. This will be the trigger that will start your zap.
Step 2: Setup the trigger app
- Select the event from the dropdown: "Catch Hook". Click continue.
- Under the "Set up trigger" step, leave the "Pick off a Child Key" blank. Click continue.
- You will now be shown your unique Webhook URL.
- Keep this URL handy. You will need this to set up Connector Campaigns.
Step 3: Setup Connector Campaign in MoEngage
- Navigate to MoEngage Dashboard.
- Use any one of the following options:
- On the All Campaigns page, click Create Campaign.
The Create Campaign page is displayed. - Click Create New > Campaign.
The Create Campaign page is displayed.
- On the All Campaigns page, click Create Campaign.
- Click Custom under Connectors.
- For the campaign delivery types, choose "Event-Triggered".
- For more information about delivery types, refer to Delivery Types.
- On the next screen, give your Campaign a name, and select the Criteria as "Device Uninstall".
- For trigger, choose "immediately".
- For the audience, let us choose "All users" for this use case. Click "next" when satisfied.
- On the content screen, we will define our payload and webhook URL we got from the previous step.
- Choose the method as "POST" (know more about Webhooks on Zapier).
- Enter the webhook URL you copied earlier.
- Define the headers and parameters as per your requirements. For this use case, we will just define our payload body- (you can type @ to insert personalized values as well)
- Now you need to test this webhook, scroll down and enter a test user's data and click on "test".
- You should see a new modal saying the test was successful:
- Now go back to the Zapier editor.
Step 4: Test Webhook Setup on Zapier
- Click on "Test Trigger" to pull in the test campaign you just sent in MoEngage.
- Once you are satisfied with this data, you can publish the Connector Campaign on MoEngage.
- Back in Zapier, click continue to add the next step in your workflow.
Step 5: Add Slack as the Action app
Click on "+" to add a new step. Then, search for "Slack" from the apps and select it.
Step 6: Setup Slack Action
- From the event dropdown, select: "Send Direct Message". Click continue.
- Now you need to connect to Slack. Once you are done, choose the connected account from the dropdown and click continue.
- In the next step "Set up action", you will see a form for you to either fill in or map from the previous step. We will just fill in the values for "To Username" and "Message Text". Make sure to select "Yes" for "Send as a bot?".
You can also map data from the previous step:
The form could look like this:
- You will now be presented with an option to test this setup.
- Click on "Test & continue" to test this setup.
- If the API call was successful, you should see a "success" return.
You can also verify this in Slack. You should now see a new message there
- Once you are satisfied that everything works, click on "Publish Zap" and it will run every time a new uninstall takes place, you will be notified on Slack.
Import new Slack Users to MoEngage
Note: This workflow makes use of the Create or Update User Action.
Step 1: Select Slack as the Trigger app
- Select Slack from the list of apps.
- Choose the "Event" as "New User". Click continue.
- Connect your Slack account. Select your Slack account from the dropdown and click continue.
- Click "Test trigger" and Zapier will try to fetch a recent New User. Click on continue to move to the next step.
Step 2: Select MoEngage as the Action app
Search for "MoEngage" from the apps and select it.
- From the event dropdown, select: "Create or Update User". Click continue.
- If you have followed the prerequisites, you should see your MoEngage account already listed. You can either choose that or connect a new one. Click continue once done.
- In the next step "Set up action", you will see a list of attributes and user properties for you to either fill in or map from the previous step. Click here to know more. You can add the relevant custom user attributes as per your requirements.
- For our setup, we have linked the following:
Customer ID
->1. ID
Full Name
->1. Real Name
First Name
->1. Profile First Name
Last Name
->1. Profile Last Name
Email
->1. Profile Email
Source
-> "Slack"Other Attributes
->is_bot
->1. Is Bot
In the below images, we only show you those fields which have been mapped:
- Once you are satisfied with your mappings, click on "Continue".
- In the final step, click on "Test & continue".
- If the API call was successful, you should see a "success" return.
You can also verify this in your MoEngage dashboard. Go to your Hubspot user's profile and look under custom attributes:
You can now send campaigns by filtering users that have relevant user attributes.
Add Slack users to Custom Cohorts in MoEngage
Note: This workflow makes use of the Add or Remove User from Cohort (Audience) Action.
Step 1: Select Slack as the Trigger app
- Select Slack from the list of apps.
- Choose the "Event" as "New Reaction Added". Click continue.
- Connect your Slack account. Select your Slack account from the dropdown and click continue.
- Choose a Reaction to track, and the channel to track. Optionally, you can track reactions by individual users as well. Click continue when ready.
- Click "Test trigger" and Zapier will try to fetch a recent Reaction. Click on continue to move to the next step.
Step 2: Select MoEngage as the Action app
Search for "MoEngage" from the apps and select it.
- From the event dropdown, select: "Add or Remove User From Cohort (Audience)". Click continue.
- If you have followed the prerequisites, you should see your MoEngage account already listed. You can either choose that or connect a new one. Click continue once done.
- In the next step "Set up action", you will see a form for you to either fill in or map from the previous step. Click here to know more.
- Select if you want to add or remove a user. Fill in all the mandatory fields and you will then be presented with an option to test this setup. Do make sure you fill in at least one of "User ID" or "Anonymous ID". To know more, read the Cohort API docs.
- For our setup, we have linked the following:
Cohort Name
-> "slack-reactions-1. Reaction
"Cohort ID
-> "slack-reactions-1. Reaction
"Cohort Description
-> "All Slack users that have reacted with 💯."User ID
->1. User Profile Email
Anonymous ID
->1. User Profile Email
- Once you are satisfied with your mapping, click continue.
- You will now be presented with an option to test this setup.
- Click on "Test & continue" to test this setup.
- If the API call was successful, you should see a "success" return.
You can also verify this in your MoEngage dashboard. Go to your MoEngage Dashboard >> Segment >> Create segment. Filter users by "Custom Segment" and you should see your newly created cohort here.
This confirms that your Zap was successful.
Import Events into MoEngage
Note: This workflow makes use of the Import User Event Action.
Step 1: Select Slack as the Trigger app
- Select Slack from the list of apps.
- Choose the "Event" as "New Reaction Added". Click continue.
- Connect your Slack account. Select your Slack account from the dropdown and click continue.
- Choose a Reaction to track, and the channel to track. Optionally, you can track reactions by individual users as well. Click continue when ready.
- Click "Test trigger" and Zapier will try to fetch a recent Reaction. Click on continue to move to the next step.
Step 2: Select MoEngage as the Action app
Search for "MoEngage" from the apps and select it.
- From the event dropdown, select: "Import User Event". Click continue.
- If you have followed the prerequisites, you should see your MoEngage account already listed. You can either choose that or connect a new one. Click continue once done.
- In the next step "Set up action", you will see a form for you to either fill in or map from the previous step. Click here to know more.
Fill in all the mandatory fields and you will then be presented with an option to test this setup. To understand how to fill up this form, please read the instructions on Event API. You can also choose to add custom attributes in the form of key-value pairs and map them to inputs from the previous trigger app.
- For our setup, we have linked the following:
Customer ID
->1. Message User ID
Event ID
->"slack_reaction_1. Reaction
"Event Attributes
->message_permalink
->1. Message Permalink
- Once you are satisfied with your mappings, click on "Continue".
- You will now be presented with an option to test this setup.
- Click on "Test & continue" to test this setup.
- If the API call was successful, you should see a "success" return.
You can also verify this in your MoEngage dashboard. Go to your MoEngage Dashboard >> Settings >> Data Management >> Events >> Custom events tab >> search for "slack_reaction_100".
- Once you are satisfied that everything works, click on "Publish Zap" and it will run every time a new reaction is added to your message in Slack.