Slack (via Zapier)

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 - 

  1. Use MoEngage as a Trigger
  2. Create or update Slack contacts in MoEngage
  3. Add or remove Slack members to custom segments in MoEngage
  4. Import Events in MoEngage

Use Cases

  1. Send a Slack message when an event triggers on MoEngage.
  2. When a new member joins your Slack Workspace for the first time, create a new user in MoEngage.
  3. When a new mention (for example, support team) is sent on a public channel, add a new event in MoEngage.
  4. When a new reaction is added to your message, add the user to a cohort in MoEngage.

Integration

 

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.

UseCase2-Step1.png

Step 2: Setup the trigger app

  1. Select the event from the dropdown: "Catch Hook". Click continue.
  2. Under the "Set up trigger" step, leave the "Pick off a Child Key" blank. Click continue.
  3. You will now be shown your unique Webhook URL.

UseCase2-Step2.png

  1. Keep this URL handy. You will need this to set up Connector Campaigns.

Step 3: Setup Connector Campaign in MoEngage

  1. Navigate to MoEngage Dashboard.
  2. Use any one of the following options:
    1. On the All Campaigns page, click Create Campaign.
      The Create Campaign page is displayed.
      CreateCampaign_RightNav.png
    2. Click Create New > Campaign.
      The Create Campaign page is displayed.
      CreateCampaignLeftNav.png
  3. Click Custom under Connectors.
  4. For the campaign delivery types, choose "Event-Triggered".
    • For more information about delivery types, refer to Delivery Types.
  5. On the next screen, give your Campaign a name, and select the Criteria as "Device Uninstall".
  6. For trigger, choose "immediately".

UseCase2-Step3.png

  1. For the audience, let us choose "All users" for this use case. Click "next" when satisfied.
  2. On the content screen, we will define our payload and webhook URL we got from the previous step.
  3. Choose the method as "POST" (know more about Webhooks on Zapier).
  4. Enter the webhook URL you copied earlier.
  5. 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)

UseCase2-Step4.png

  1. Now you need to test this webhook, scroll down and enter a test user's data and click on "test".
  2. You should see a new modal saying the test was successful:

UseCase2-Step5.png

  1. Now go back to the Zapier editor.

Step 4: Test Webhook Setup on Zapier

  1. Click on "Test Trigger" to pull in the test campaign you just sent in MoEngage.
  2. Once you are satisfied with this data, you can publish the Connector Campaign on MoEngage.
  3. Back in Zapier, click continue to add the next step in your workflow. 

UseCase2-Step6-1.pngUseCase2-Step6-2.png

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.

UseCase2-Step7.png

Step 6: Setup Slack Action

  1. From the event dropdown, select: "Send Direct Message". Click continue.
  2. Now you need to connect to Slack. Once you are done, choose the connected account from the dropdown and click continue.
  3. 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:

UseCase2-Step8.png

The form could look like this:

UseCase2-Step9-1.png

UseCase2-Step9-2.pngUseCase2-Step9-3.png

  1. You will now be presented with an option to test this setup.

UseCase2-Step10.png

  1. Click on "Test & continue" to test this setup.
  2. If the API call was successful, you should see a "success" return.

UseCase2-Step11.png

You can also verify this in Slack. You should now see a new message there

UseCase2-Step12.png

  1. 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

User-Step1.png

  1. Select Slack from the list of apps.
  2. Choose the "Event" as "New User". Click continue.
  3. Connect your Slack account. Select your Slack account from the dropdown and click continue. 
  4. Click "Test trigger" and Zapier will try to fetch a recent New User. Click on continue to move to the next step.

User-Step2.png

Step 2: Select MoEngage as the Action app

Search for "MoEngage" from the apps and select it.

Import-Step4.png

  1. From the event dropdown, select: "Create or Update User". Click continue.
  2. 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.
  3. 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.
  4. For our setup, we have linked the following:
    1. Customer ID->1. ID
    2. Full Name->1. Real Name
    3. First Name->1. Profile First Name
    4. Last Name->1. Profile Last Name
    5. Email->1. Profile Email
    6. Source-> "Slack"
    7. Other Attributes->is_bot->1. Is Bot

In the below images, we only show you those fields which have been mapped:

User-Step3-1.pngUser-Step3-2.pngUser-Step3-3.png

  1. Once you are satisfied with your mappings, click on "Continue".
  2. In the final step, click on "Test & continue".
  3. 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:

User-Step4.png

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

User-Step1.png

  1. Select Slack from the list of apps.
  2. Choose the "Event" as "New Reaction Added". Click continue.
  3. Connect your Slack account. Select your Slack account from the dropdown and click continue. 
  4. Choose a Reaction to track, and the channel to track. Optionally, you can track reactions by individual users as well. Click continue when ready.
  5. Click "Test trigger" and Zapier will try to fetch a recent Reaction. Click on continue to move to the next step.

Cohort-Step1.png

Step 2: Select MoEngage as the Action app

Search for "MoEngage" from the apps and select it.

Import-Step4.png

  1. From the event dropdown, select: "Add or Remove User From Cohort (Audience)". Click continue.
  2. 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.
  3. 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.
  4. 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.
  5. For our setup, we have linked the following:
    1. Cohort Name-> "slack-reactions-1. Reaction"
    2. Cohort ID-> "slack-reactions-1. Reaction"
    3. Cohort Description-> "All Slack users that have reacted with 💯."
    4. User ID->1. User Profile Email
    5. Anonymous ID->1. User Profile Email

Cohort-Step2.png

  1. Once you are satisfied with your mapping, click continue.
  2. You will now be presented with an option to test this setup.

Cohort-Step3.png

  1. Click on "Test & continue" to test this setup.
  2. 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.

Cohort-Step4.png

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

User-Step1.png

  1. Select Slack from the list of apps.
  2. Choose the "Event" as "New Reaction Added". Click continue.
  3. Connect your Slack account. Select your Slack account from the dropdown and click continue. 
  4. Choose a Reaction to track, and the channel to track. Optionally, you can track reactions by individual users as well. Click continue when ready.
  5. Click "Test trigger" and Zapier will try to fetch a recent Reaction. Click on continue to move to the next step.

Cohort-Step1.png

Step 2: Select MoEngage as the Action app

Search for "MoEngage" from the apps and select it.

Import-Step4.png

  1. From the event dropdown, select: "Import User Event". Click continue.
  2. 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.
  3. 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.

  1. For our setup, we have linked the following:
    1. Customer ID->1. Message User ID
    2. Event ID->"slack_reaction_1. Reaction"
    3. Event Attributes->message_permalink ->1. Message Permalink
    4. Once you are satisfied with your mappings, click on "Continue".

Event-Step2.png

Event-Step2-2.png

  1. You will now be presented with an option to test this setup.

Event-Step1.png

  1. Click on "Test & continue" to test this setup.
  2. 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".

Event-Step3.png

  1. 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.
Was this article helpful?
0 out of 0 found this helpful