Events

Events, a feature available in Moments, are focused on customer activities. Some of the most common activities are installing/uninstalling apps, searching for items, filling out forms, and purchasing items. When customers navigate through a website or a mobile app, they interact with it by clicking on specific elements, placing orders, or using features. Based on that behavior, you can create engaging messages for relevant audiences.

Where are Events Stored?

The People page on the Infobip web interface contains Person Profiles. This is where you will find information related to a specific customer, including their Attributes (first name, last name, birthday), Contact Information, Tags, and Events.



Select the Events tab for a quick overview of the activities involving your customer.

 

Events Properties

The Infobip Events service has properties that are optional and based on the information you are looking to obtain. Properties consist of parameters associated with individual events. For example, if your mobile app user buys an in-game currency, the parameters you would want to include might be the revenue and amount.

Another good use case can be found in e-commerce, where businesses are struggling to make customers return to their abandoned carts. To track customer actions, you need to log in to the Infobip web interface and go to the People module. Open the Events tab and you will be able to set up an Added to Cart event and decide on the parameters. In this scenario, the parameters could be productName and productPrice.

NOTE

Currently, you can select String, Decimal, Integer, and Datetime as parameter types in the event properties.

Events Definitions

Before the events are sent, they have to be configured on the Create New Event Definition page: type in the event title, definition ID, event description, and event properties. The definition ID will be used for tracking.

NOTE

These definitions apply across the main account and its subaccounts.

Tracking Events

There are three ways to track events: JavaScript SDK, API, and Mobile SDK. In this section, you will find guidelines for all of them.

JavaScript SDK

JavaScript SDK allows you to capture events from the front-end of your app. You will be able to pass additional contextual parameters from the user device (e.g. from the browser).

1. On the Events page (inside the People module on the Infobip web interface), select the Web SDK tab. Next, copy and paste the code snippet to all the pages on your website.




2. Set up event definitions as explained in Events Definitions, and get the definition ID that you will use to track events. 

3. Identify persons so we know who is associated with the specific event.
 
a. To identify a person, use JavaScript call: pe.setPerson({ email: "someone@email.com" });
 
b. Use email, phone, or pushRegId as an identifier.
 
  • If you provide an email address or phone number and there is no person in the Infobip People module with that same information, a new user will be created with the provided identifier.
     
  • If you provide pushRegId or externalId as an identifier and there is no person in People with that same data, a new user will not be created, but you can still send events.

4. Send events.

a. To send an event, use JavaScript call: pe.track("DEFINITION_ID", { property: "property_value" });

5. You are ready to start creating an automated Flow or Segments.

NOTE

Events sent for an unknown visitor will be stored in that user’s browser under LocalStorage, and as soon as the user becomes known (you provide email, phone, or pushRegId for that user), we will send events that happened in the last 24 hours before the identification. Events will be recorded on the date they were sent to our system.

Events API

API is generally considered a more secure approach when it comes to sending events to Infobip from any back-end system. For implementation details, please see the developers’ guide.

The following are the quick steps to set it all up:

1. Create a Public API Key on the Settings page.

2. To send events via API, please adhere to our API specification and use the following:

  • {{personId}} - unique person identifier (email, pushRegId, phone)
  • {{definitionId}} - definition ID from the Event Definition page
  • {{AppKey}} - API Key from the Settings page
  • {{Your personal Base URL}} - base URL you can get after logging in

Apply the POST method:

POST /persons/{{personId}}/definitions/{{definitionId}}/events
Host: {{your personal Base URL}}/peopleevents/1
Authorization: App {{AppKey}}
Accept: application/json
{
"properties": {
 "property_key": "property_value”,
}
} 
NOTE

If the property value is a string, put it inside the quotation marks. If it`s not, do not use quotation marks.

Unlike JS SDK, API lets you send events related to a person identifier that already exists in the Infobip People module. If you send an event with a person identifier which does not exist in People, you will get an error.

Mobile SDK

Mobile SDK serves to capture events from the mobile app. It involves standard and custom events.

Standard events are enabled for all the Moments users who have Mobile SDK implemented in their mobile app, and you don’t need to perform any additional actions to be able to track them.

List of standard events:

1. Personalize

2. Depersonalize

3. Install

4. Uninstall

5. App Launch

Custom events are those that you have defined yourself and want to track via Mobile SDK.

Learn more about how to set up mobile events tracking on iOSAndroid, React Native, and Cordova.

Segments Based on Events

Events can be used to either build automated communication flows (for example, the abandoned cart flow) or segments of people that will be used in future campaigns. 

The following steps show how to create a segment of people based on events:

1. In the People module, select the Segments tab.

2. Click CREATE SEGMENT.

3. Enter the segment title.

4. Specify the attributes that will help you segment your audience more efficiently (use 'and' and 'or' clauses).

5. SAVE the segment.

6. Now it is ready to be used in Broadcast.

Automated Campaigns Based on Events

We have created a quick guide to help you set up an automated communication – Flow. The example we are using here starts right after the events have been configured.

1. Go to the Communicate module on our web interface and click CREATE FLOW.

2. Select Start from Scratch > New people events > START BUILDING. The Wait for an event element will appear as your flow entry point.

3. Decide which specific event should start the flow. In this example, we will create the Checkout_started event, and once the user starts the checkout, they will be added to the communication flow.



4. Specify an action to be taken. For example, select Wait for an event element and then Checkout_finished as the event you will be waiting for. Enter the amount of time you want to wait for this action to happen.

5. Next, you can add more actions, including sending communication (e.g. SMS, email), segmenting the audience based on the previous events and person attributes, and more.

Event Occurrences

When adding the Wait for an event element, you will need to set up the event occurrences. The Event occurrence types are happened and not happened.

Happened means that as soon as an event happens to a person, the communication trigger will be activated. You can also set the time and number of occurrences. For example, if you would like to trigger your Flow and send communication every 5th time some event happens within a 7-day timeframe, you would specify the time as “within the last 7 days” and a number of occurrences as “equals 5 times.”

Not happened serves to confirm that some event hasn’t happened for the user. It can only be used in conjunction with another condition.

Moreover, various occurrence types can be combined within the same element, as shown below.

TIP

You can also narrowly define conditions for the event properties. For example, you don`t want to wait for all purchases, but only for purchases over 150 U.S. dollars.

If a person has already fulfilled the conditions that you are including in the flow, that person will not enter the flow, at least not at this point. However, if the flow is recurrent, that same person could enter the communication later if they happen to match the set criteria sometime in the future.

​​​If you are still wondering what engagement strategy would be the best fit for your company, browse through the use cases.

Internal Events

Events generated when your customers interact with the services provided by Infobip are called internal events. They are available in all events related features: Moments Analytics, People Real-Time Event trigger and element, and Segments. You can use them to analyze customer behavior or to reshape the communication based on that behavior.

Internal events presently include Channel Events and People Events. People Events reflect the changes in a person`s profile, while Channel Events show the message status and what happens with messages - if the email has been opened, link inside SMS clicked, push notification delivered, and more.

Channel Events

All channels that currently work with this feature have a set of events that you can choose from when you want to track the status of your messages and how customers react to them.   

  1. Events from the Email element: 
  • Sent
  • Delivered
  • Opened
  • Clicked
  • Unsubscribed
  • Complained
  1. Events from Push:
  • Sent
  • Delivered
  • Opened
  1. Events from SMS:
  • Sent
  • Delivered
  • Clicked

What`s more, each channel event has its associated properties visible on the Channel Events page on the Infobip web interface:  

CampaignId – found in each campaign`s URL, it represents the unique identification number. There are scenarios where you need to include them to be able to follow what happens with the messages from your communication flow.

FlowActionId – an ID of the Flow element that has sent a message.

Source - Broadcast, Flow, API, Conversations.

OriginalTime – message sending time.

The properties are created automatically, and can also be found on the communication campaign cards. Go to People, click a profile card, and then the Events tab. Every campaign that involves channel events contains this information.

campaign id on cpaas


Enable Channel Events

Navigate to the People module >  Events >  Channel Events. Select the events that you want to use.

events by channel
NOTE

Once you decide which channel you want to use as a source of internal events, make sure you have that channel configured. Reminder: channels available with internal events are Email, SMS, and Push.

People Events

Create engaging messages based on the following updates in the customer profile:

  • Standard attributes

           Name changes

           Location changes

           Other changes such as date of birth or gender identification.

           Tag changes

           Contact information

Enable People Events

When you go to the People module > Events, and select specific standard and custom attribute changes, they will become available for use in other modules on our web interface. For example, this means that you will be able to modify your campaigns in the Moments module based on updates such as customer new location, recent purchases, and similar activities. 
 

events created by user activity

TIP

We recommend that you do not include the attributes that you don`t really plan to use; they will only clutter the interface.

If you go to the profile card in the People module, People Events will appear like this: 

internal events visible on user profile cards

 

Internal Events in Flow

The communication flow can be steered based on user interaction or lack of interaction with a message. Let`s suppose that your message has been delivered but not read. With internal events, you will be able to send a follow-up message, switch to another channel, or do something else.

When you add the Wait for an event element to the flow, the communication can be branched depending on the way the user responds to messages. Another option is the People Real-Time Event trigger which will start your communication using a specific event.

select user events for cpaas communication

Internal Events in Segmentation

If you plan to build specific audience segments, internal events will let you have an even more detailed insight into user behavior as you will be able to see the following:

  • The specific pattern of interaction with your messages.

           Example: a customer hasn`t opened your email message within the last 30 days.

  • Specific profile changes

           Example: customers whose attribute LoyaltyLevel changed. 

Internal events in segmentation can be used in conjunction with person attributes and external events.

audience segments and internal events

Internal Events in Analytics

Events Segmentation and Funnel Analytics both offer the possibility to use internal events. Inside the Moments module, select, for example, Funnel Analytics, and from the drop-down list select the internal event you would like to use.

internal events in funnel analytics

The events you choose will be used as a step in a funnel. If you opt for Events Segmentation, internal events will let you create a specific segment of the audience that you want to analyze.