How can we help?

Events

Overview

The event data collection, which is referred to as contactactivites in the database, contains behavioral data records for all contacts in the system. These include reserved message events, system events, and custom-named events associated with website behavior, such as browse, order, and cart. The event data collection also contains external events captured by IoT devices, such as opened door or triggered alarm.

Each event is associated to a contact via the contact's primary or secondary identifier. You can use this data to personalize your messaging based on real-time behaviors.

Reserved message events

  • message-sent
  • open
  • click
  • optout
  • bounce
  • complaint
  • message-stopped

Event data can be used to personalize content in a messagebuild an audience, trigger message sends, and build analytics reports. For a complete list of events supported by Cordial, visit our system events reference page.

How Cordial stores events

The following is an example of JSON-formatted event data stored within the Contact Activities Collection.

[
   {
    "cID": "58c6dae96e05abd5fef72184",
    "_id": "58c7170250c860b711c3af04",
    "properties": {
      "category": "Shirts",
      "url": "http://cordial.io/demo",
      "description": "Really cool shirt.",
      "price": 10.5,
      "title": "Red Shirt"
    },
    "action": "browse",
    "time": "2017-03-13T22:02:42+0000",
    "email": "fredgarvin@example.com"
  },
  {
    "cID": "58c6dae96e05abd5fef72184",
    "mcID": "45:dfd5c31449b9fb9f42da7bb0a79f94ee:d170313:58c6dae96e05abd5fef72184:1489445319",
    "mdtID": "56e85788733462ca899bc891",
    "_id": "58c721c867b929236e8b4567",
    "action": "message-sent",
    "time": "2017-03-13T22:48:40+0000",
    "bmID": "45:dfd5c31449b9fb9f42da7bb0a79f94ee:d170313",
    "email": "fredgarvin@example.com",
    "properties": {
      "stp": "dyn"
    }
  },
  {
    "cID": "58c6dae96e05abd5fef72184",
    "mdtID": "58c839b36e05abd5fefc63aa",
    "mcID": "45:f2a318f9a064d93760c4beaa39970d72:d170323:58c6dae96e05abd5fef72184:1490308322",
    "first": true,
    "_id": "58d44d7d5c90d40c7992ca66",
    "action": "open",
    "time": "2017-03-23T22:34:37+0000",
    "bmID": "45:f2a318f9a064d93760c4beaa39970d72:d170323",
    "email": "fredgarvin@example.com"
  }
]

The above example shows three events associated with the same contact: a browse event, a message sent, and a message open. The events associated with a message contain additional information about the message. The browse event shows additional information about the product that was browsed, like title and price.

How Cordial creates events

Message events

Message event data (send, open, click, bounce, and more) is created and stored automatically in the system when a message event takes place.

Message events are inherently system-generated events associated with message sending activity.

System events

Similar to message events, these events are predefined and capture corresponding activities as they occur. System events have a crdl_ prefix. You can view the available system events on our System events reference page.

Custom-named events

Custom-named events are created by you according to your marketing strategies.

In order to send your subscribers a cart abandonment message, you need to create a custom-named event like "cart" to be used as a trigger to send an email when a contact adds an item to their cart. In this scenario, you would likely create another custom event called "order" that would be used to cancel the cart abandonment message should the contact complete the purchase.

Track browse behavior

You can also create custom-named events to track browse behavior on your website. These browse events can be used to trigger a browse abandon message when a contact leaves your site without purchasing anything.

The sky is the limit with custom events

There are countless opportunities to trigger personalized messages based on custom events. Custom events can be created for when a video is viewed, a PDF is downloaded, or an article is liked. Custom events can also be created based on IoT behaviors such as triggered an alarm, or opened a door. The options are limitless. 

Regardless of the event name, all custom-named events are passed to Cordial using JavaScript listeners embedded on your site, or via an API call.

Custom events contain the name of the event (such as browse, cart, or order), as well as the optional properties associated with that event such as a URL, images, or descriptions.

The default maximum number of properties an event can have is 1,000.

View event data

Event data is viewable in the UI or via the API. To view event data in the UI, navigate to Analytics > Event Data Reports. You can filter the report results by event type, contacts, audience rules, and date ranges.

Event data is also viewable via the API. You can make an API call to view all events or filtered events.

Export events

You can export event data via a data job in the UI or with an API call.

Export events via UI

1. Log in to Cordial and navigate to Data Jobs > Create New Data Job.

2. Under Export, select Events.

3. Fill in the Name and Tags fields. For Type, choose either One-time or Recurring. Assign a Priority for the job and click Continue.

4. From the Data Job creation page, click Edit in the Data Source pane.

5. In the Events pane, configure the events you'd like to export: specify the actual Event, Contacts who triggered the event, and the Date range for when the event(s) were triggered. 

6. Select Edit under Data Mapping and enter the required fields:

  • Export file name: give your file a unique name consisting only of letters and numbers
  • Export file type: choose CSV or JSONL
  • Attribute key(s): specify the attribute key(s) to use in your export
  • List key(s): specify the list key(s) to use in your export
  • Check the Header box to include a header row in your exported file
  • Select whether to Compress file(s) or Split file per chunks. If splitting the file, specify the amount of records to appear in each file.

7. Select Edit under Data Destination and choose the destination for your exported events file. You can select Local, FTP, SFTP, AWS S3 bucket, Google Cloud, or Azure Blob.

This method of exporting events automatically prepares that data for the destination you specify above, so you don't need to run an additional data transformation.

8. In the On Completion pane, enter an email address where you'd like to receive a notification once the job is complete. This step is optional.

9. If your data job is recurring, Publish the data job then select Recurring under Settings on the left. From here, set the Schedule for your data job and then Enable it.

10. Run the export events data job. Once completed, you can find the job under the Jobs Widget.

Export events via API

Use events in message content

You can personalize message content based on a contact's event behavior using the Smarty getEventRecords method. With Smarty, you can query event data per contact, filter and sort records, and then display the event and its associated properties in a message.

Personalizing message content based on event behavior is useful in browse abandon campaigns where a contact viewed items on your website but didn't add anything to the cart or make a purchase. You could trigger a message with a browse event and display the last four items they browsed in the message.

Build audiences based on events

Using Cordial's Audience Builder, you can create audiences based on message events and custom-named events.

1. Navigate to Contacts > Audience and edit or create a new audience.

2. Select System events from the Rules dropdown in the Audience Builder.

3. Drag the events you want to use into your audience.

The image below highlights the audience rules associated with events.

Use case

You can combine audience rules to create complex queries such as: "Show me all females that browsed the women's category in the last 7 days and opened any message in the past 30 days."

Trigger messages with events

With message automations you can trigger message sends based on custom-named events. 

1. Select or create a message automation: Cordial Dashboard > Message Automation

2. In the message creation dashboard, navigate to Sending Methods > Event Triggered in the left sidebar.

3. From the Trigger Events pane, choose the desired trigger event: 

  • When a change is made to a contact attribute value
  • When a contact is added to a list
  • When a change is made to a contact attribute supplement record
  • When an order is created or updated
  • A contact's real-time behavior

Contact your CSM to enable supplement, order, and system triggers in your account. Custom event triggers are enabled by default.

Use case

If you have a custom event called "browse-cat," you could trigger a message when that event is passed to your account.

Trigger messages when an order is created or updated

You can trigger messages when orders are created or updated. For example, you could trigger a message based on an order's status changing from shipped to delivered. 

1. In the Trigger Events pane, select When an order is created or updated for the Trigger event.

2. Select the Trigger strategy you want to use:

  • Trigger when an order is created or updated
  • Trigger only when an order is updated (ignore new orders)
  • Trigger only when an order is created (ignore existing orders)

3. Under Changed field, select the event change that will trigger the message, such as when an order's status changes from shipped to delivered. 

4. Add a Conditional filter as needed. 

5. Set the Delay, select whether to Enable quiet hours, and choose How often can this message be sent to an individual.

The $triggerData utility contains both old and new order data, which you can differentiate in Smarty to display additional changes.

Create analytics reports using events

System and custom-named events can be visualized over time using event dashboards. You can create event data reports for viewing and exporting all events as a report. You can also view audience populations based on events with audience trend reports.

Audience Trend reports

To access Audience Trend reports, log into Cordial and navigate to Analytics > Audience Trends. From here, you can view the population of an audience over time, based on an event such as website browse activity.

Use case

You can create an audience of contacts that have browsed the Shirts category, save the audience with audience trend analytics enabled, and then view the population over time on an audience trends chart.

Event Dashboards

Event Dashboards provide a way to create multiple charts of time-based event activity. This allows you to compare contact behaviors on your website with message activity, providing a holistic view of your marketing performance.

To create an event chart, navigate to Analytics > Event Dashboards and select Add Chart.

Use case

You could create a series of charts that visualizes website browse activity of multiple categories, message engagement, abandonment, and purchases.

Event Data reports

You can generate a report of all events passed to your account on the Event Data reports pagenavigation: Analytics > Event Data Reports. This provides you with a log of all events in chronological order. You can filter the event report by event type, contact, audience, and date range, as well as download the report to your local computer or a remote server.

In the next article, you can learn about products

Comments

0 comments

Please sign in to leave a comment.