Skip to main content
All Collections3rd Party IntegrationsOther Integrations
What, Why, and How of Activity API - A Detailed Rundown
What, Why, and How of Activity API - A Detailed Rundown
Danielle From BayEngage avatar
Written by Danielle From BayEngage
Updated over a year ago

This help document will assist you in understanding the following:

  • What is an Activity API?

  • What is the need for an Activity API?

  • What is the scope of using this feature?

  • How to it set up with the custom integration feature on BayEnagage?

While the default user activity triggers [1] cover some of the most common user actions, you may have other user activity/action specific to your business that you'd like to leverage to hyper-personalize your customer's journey. Activity API helps you do just that.

What is an Activity API?

A feature available on BayEnage that allows you to specify any user action/behavior as a flow trigger in addition to other default actions configured to act as triggers.

Activity API opens up endless possibilities and enables you to designate any user action that is highly specific and unique to your store to carve out a fully customized/tailored user journey, thereby empowering you to optimize your marketing efforts further.

Since this feature enables you to set any user action as the trigger, it is NOT confined just to actions performed by users in an eCommerce store. Rather it can be used across industries and businesses like restaurants, libraries, banking, etc.

Let’s take two examples to understand Activity API better:

Example 1: Non-eCommerce example

Imagine owning a brick-and-mortar bookshop with a digital presence. Let’s say you wish to send book recommendations to buyer according to the author/genre of the books they have last purchased. This is an example that is very specific to your business. Pre-built automations will not be able to cater to a personalized user experience based on their author.

But, with Activity API, you can achieve just that. Upon setting up the API integration, the activity properties will be synced into BayEngage which you can use as the activity filtre/trigger for the respective automation flow.

Here the activity property captured would be: Purchased a book by Harper Lee/in the fiction genre and the same can be set as the activity filter/trigger

The automation flow would look something like this:

Once a customer qualifies & enters this automation flow an email with a list of recommended books would be sent to them.

Sample of the email:

In the above example, you can see that activity you can personalise the email with the customers user properties like name, date of purchase, age, etc.

You have the flexibility to define any action as the trigger to send personalized but automated book recommendations. In the above example, the action that would trigger the book recommendation automation would be ‘all the people who have purchased a books written by Harpeer Lee/ in the fiction genre.

Example 2:

Say you are an eCommerce store that designs custom bridal dresses. Upon accepting an order, the order is confirmed. But you would require their measurements in order to customize it. Therefore it is necessary for your customers to update their measurements in order to process and complete the order.

In this case, you would wish to send an email requesting for the measurements to be uploaded. In the above example, the activity of a customer placing an order without measurements will be the activity property that is captured & subsequently will be the activity filter/trigger of the automation workflow which will contains an email asking them to upload their measurements.

Here the activity property captured would be: Placed an order without measurements and the same can be set as the activity filter/trigger.

Following the successful update of the measurements you can set up a ‘Thank You!’ email & in cases were the customer fails to update their measure your can softly nudge them to upload in order to deliver the order without any time delay in the automation workflow.

The automation flow would look something like this:

Sample of the email:

What is the need for an Activity API?

Consider the following questions before getting started with why your business needs this feature:

  1. Or are you restricted from creating custom automation specific to your business and user activity?

  2. Are you limited from hyper-personalizing your user journey by the pre-built customer action/activity triggers configured/specified on your email marketing platform?

If your answer is Yes, BayEnagage’s Activity API (custom integration) is all you need.

Testing prior to Integration

A preview of the Integration setup and how the real-time user action will lead to collecting the respective user properties, activity properties and triggering an automation flow is tested via ‘Postman’

Upon establishing the integration, these user and activity properties will be mapped automatically and flow into BayEngage’s system, enabling you to segment your audience and use them in your email flows.

Setting up BayEnagage establish the integration:

  1. Log in or create an account by logging into to BayEngage account

2. Navigate to ‘Apps’ from the left-hand side menu and install ‘Custom Integration’ from the list of apps

Postman Configuration Set up:

Note: It is necessary to maintain the format of the following data /activity payload and also the overall data format for proper configuration:

a. "key"

b. "activity_name"

A sample code has been shown below:

{

"key": "XXXXXXXXXXXXXXXXXXXXXXX",

"activity_name": "hotel_booking",

"user_properties": {

"first_name": "Adam",

"last_name": "Smith",

"email": "adam@google.com",

"list_uuid": "ee0570649fa8",

"gender": "Male"

},

"activity_properties": {

"location": "Chicago",

"price": "$100/night",

"room type": "luxury_suite",

"booking_platform": "traveladvisor",

}

}

  1. To find your unique ‘key’, click on the setting in your ‘Customer Integration’ App found under ‘My Apps’

  1. Now click on ‘generate public key’ and ‘confirm’ to generate the ‘key’.

  1. Once the public key is generated, click on ‘Copy Client Secret Key’ to copy the key.

  1. Navigate to Postman and replace this ‘key’ value in the code with the copied client secret key

{

"key": "XXXXXXXXXXXXXXXXXXXXXXX",

"Activity_name":

  1. Configure the ‘activity name’ in the same format as prescribed below.

    For example - Say you wish to promote your chain of hotels in other locations to visitors who have already stayed at your hotel previously. In this case, hotel booking is the user activity based on which a series of automated emails are to be triggered.

"key": "XXXXXXXXXXXXXXXXXXXXXXX",

"Activity_name": "hotel_booking",

  1. Define the user properties, which refers to the attributes of the customer/user you wish to capture, such as first name, last name, email, list uuid (list to which the specific customer should be added), gender, age, DOB, etc.

For example -

"user_properties": {

"first_name": "Adam",

"last_name": "Smith",

"email": "adam@google.com",

"list_uuid": "ee0570649fa8",

"gender": "Male"

* The list uuid can be found under the ‘setting’ option of the respective list to which you want to add the recipient under ‘lists & segments

7. Having defined the user properties, go ahead and configure the activity properties which refers to the attributes of the customer/user action you wish to capture. In the example given, some of the activity properties you might want to capture are:

  • The location at which the hotel was booked at

  • The price of the room

  • The type of the room

  • From which platform was the booking made

"activity_properties": {

"location": "Chicago",

"price": "$100/night",

"room type": "luxury_suite",

"booking_platform": "traveladvisor"

}

While the user properties can be used to give the customer a personalized journey, the activity properties can be used to give the customer the right recommendation/ retargeting, resulting in better engagement & relevance, leading to the customer taking the right/intended action and, ultimately better sales.

Using the collected user and activity properties in automations and email campaigns

You can view all the user and activity properties captured on the BayEngage by following the below mentioned steps:

Step1: Navigate to our BayEngage account

Step 2: Click on Apps from the left-hand side menu

Step 3: Click on Activity Stream to view all the activity properties captured

  • Indicates that this activity is used in automation, will be easy to know which activity are actively used in automation.

  • Zapier and other 3rd party integration will also appear in this activity stream page.

  • When View is clicked we can see the list of users who have come under the given activity

Step 4: Click on User Stream to view all the user properties captured

Step 5: On click of view we get the information that is synced, on clicking the email address we are redirected to the contact page

These activity and user properties captured can be used in your automations & email templates.

Did this answer your question?