How to Send Notifications for a New Episode

Introduction

As a marketer, if you want to send a new episode alert to your users, you don’t have to manually send a campaign to the target audience every time a new episode is released. In this article, I would like to demonstrate how you can set up campaigns once in a lifetime and just watch how MoEngage does the rest of the job for you. We will use Business Events functionality in MoEngage to achieve this.

Expected Result

business event push.png

I would like to take the example of the Friends TV show, one of my all-time favorites, and send a push notification for the episode - The one with Joey’s Fridge. We will use MoEngage Business Events API to send the alert, and you need to have software like Postman, which can help you trigger API calls to MoEngage servers. I am listing down the broader steps we need to follow to achieve this use case, and each will be explained in detail.

  1. Setup Postman to add a new Business Event to MoEngage.
  2. Register a new type of Business Event along with its schema with MoEngage. We will call this new Business Event a New Episode
  3. Create a campaign on MoEngage dashboard using the Business Event created in Step 2.
  4. Trigger the campaign created in step 3 every time an episode is released.

Set Up Postman

Postman is used here for demonstration purposes. Ideally, your engineering team should integrate these APIs with the content management system you have and they can trigger these APIs from their backend servers.

If you don’t have Postman installed yet, kindly download it and sign in using your email address. MoEngage documents all the APIs in a publicly downloadable collection here - https://www.postman.com/moengage-dev/workspace/api-docs/overview . After you open this page in the browser, export the Business Events API collection from MoEngage space and import that into your workspace in Postman.

business events 30.png

We will now add a new business event to my MoEngage account.

Register a New Type of Business Event

First, We must let MoEngage know what this Business Event contains to be used while configuring the campaign content. Business Event for an episode would typically have the episode's name, number, image, etc. Let’s send this information to MoEngage using the Create Business Event API, and it broadly needs the event name, attributes, and who created the event.

First, I will start giving a name to this event - let’s call it New Episode. We will have support@moengage.com as the email address that has created this event. We will add the following event attributes to the business event along with their data types.

  1. Name of the Series - string
  2. Episode Name - string
  3. Episode Number - int
  4. Episode Image - string
  5. Episode URL - string (This can be used to direct the user to the content instead of having user search for it.)

Let’s form a simple JSON using the above information and add it to the API. The JSON would look like this - 

JSON

{
  "event_name": "New Episode",
  "event_attributes": [
    {
      "attribute_name": "name of the series",
      "attribute_data_type": "string"
    },
    {
      "attribute_name": "episode name",
      "attribute_data_type": "string"
    },
    {
      "attribute_name": "episode number",
      "attribute_data_type": "int"
    },
    {
      "attribute_name": "episode image",
      "attribute_data_type": "string"
    },
    {
      "attribute_name": "episode url",
      "attribute_data_type": "string"
    }
  ],
  "created_by": "support@moengage.com"
}

 We can copy this JSON in the Body of the API, fill in the required values in Authorisation, and send the request to the right data center where your account is located.

To verify if adding a business event has succeeded, go to a business event-triggered campaign and check the business event drop-down. You should be able to see your new business event there.

ezgif-1-91475c00d3.gif

Create a Campaign

Now that we have the business event details, it’s time to create a push notification campaign using these details to personalize the campaign. Go to the campaigns page and select business event campaign from the Create Campaign section.

We can use the content in the trigger event(explained in the next section) to personalize the push message. I am adding the series name to the title, the episode name to the message, and the episode URL to the deep linking. Identify the proper segmentation criteria for this campaign. For example, I targeted customers who had watched any Friends episode in the last three days.

ezgif-1-389fc2f3cf.gif

After you have successfully created the campaign, it’s time to send a trigger that will send push notifications to the users based on the segmentation criteria mentioned in the campaign.

Trigger the Alert for a New Episode

For the demonstration, I will trigger this API via Postman. Still, for all practical purposes, this event should ideally be triggered when a new episode is added to your content management system. 

To trigger the alert, we will use another business event API, trigger API. For this API, we have to pass the actual values of the new episode, which will be sent as part of the push notification. We must use the same data types we used while creating the business event.

I have used the following payload to trigger the campaign.

JSON

{
"event_name": "New Episode",
"event_attributes": {
"name of the series": "Friends",
"episode name": "The one with Joey's Fridge",
"episode number": 19,
"episode image": "https://image.moengage.com/showcasemoengage/20230907052100588487CT730Mfriends619jpgcompshowcasemoengage.jpg",
"episode url":"https://myapp.com/friends/season6/episode19"
},
"triggered_by": "support@moengage.com"
}

If you can trigger the API successfully and are part of the audience, you should have received a push on your device.

ezgif-1-ab0ff141a6.gif

Conclusion

Business events have made running campaigns without manual intervention easy, set up for one time, and forget about it. We would like you to try it. Kindly contact our team if you need help.

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?