How can we help?

Orders

Overview

Order data is stored in the Orders Collection. This collection contains all data associated with a purchase event. Order data can be used to personalize content in a message and build an audience.

For more information on order attributes and requirements, you can read about order data and the API.

How Cordial stores orders

Below is a simple example of an order stored in the Orders Collection as a JSON object. The example includes the reserved fields productID, sku, and category, as well as an object of customized attributes: color and size.

[
  {
    "orderID": 1,
    "cID": "55d7294629aa544d75c6b810",
    "purchaseDate": "2015-10-29T15:05:00+0000",
    "properties": {
      "custom_order_key": "custom_order_value"
    },
    "items": [
      {
        "productID": "1",
        "sku": "sku",
        "model": "mymodel",
        "category": "garment",
        "name": "dress",
        "qty": 1,
        "amount": 2.5,
        "attr": {
          "color": "blue",
          "size": "xs"
        },
        "properties": {
          "custom_order_item_key": "custom_order_item_value"
        }
      }
    ]
  }
]
Note: The most common order-related attributes are required by default. These required fields include email, order ID, and purchase date. The items object is optional. If the items object is included, the product ID, SKU, category, and name item fields are required. Some attributes are set as arrays and can include customizable name/value pairs such as color:blue, size:large, and much more.

Import orders

Order data is imported into Cordial via the API, or with JavaScript listeners embedded on your site. 

View orders

View orders via API call

An order collection can be viewed with an API call.

View orders via message preview

You can view the orders specific to a contact using a Smarty utility. Simply paste the following code into an HTML message and click the Preview button to see all the orders for the previewed contact.

{$orders=$utils->getOrders()} 
{$utils->jsonPrettyPrint($orders)}

Use orders in a message

Message content can be personalized with order data using the Smarty getOrders method.

Use case: You could send a contact a message with information on products they ordered.
Note: When displaying product meta data related to an order (images, descriptions, etc.), we recommend that you pull that data from the product catalog because it might be more up to date.

Build audiences with orders

Using the Audience Builder, you can create audiences of contacts that purchased a certain product. Additional properties about the product can be used to filter the results.

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

2. Select Orders from the Rules dropdown in the Audience Builder and drag the rule into your audience.

Use case: You could create an audience of all contacts that have purchased the Vintage Whisper V-Neck Tee within the past 30 days and send them a personalized message with recommended product accessories or related products from your catalog.

Build analytics reports using orders

Audiences based on orders can be saved as audience rules and either visualized over time with audience trend reports, or used as filters for event data dashboards and event data reports.

Audience trend reports

To access audience trend reports, log in to Cordial and navigate to Analytics > Audience Trends. From here, you can view the population of an audience over time based on their order history.

Use case: You could create an audience based on if a contact has made a purchase in the last 30 days. To do so, enable audience trend analytics on the audience rule, and then view the population over time on an audience trends chart.

Filter Event Dashboards

Event Dashboards provide a way to visualize event activity over time by creating customizable charts. You can take advantage of orders in event dashboard charts using audience filters.

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

To edit an event chart (also called a time series chart), navigate to Analytics > Event Dashboards and select Chart Settings in the upper right corner of the chart.

Use case: You could create a chart that plots message activity over time and is filtered by a saved audience rule where the contact has placed an order in the past 30 days.

Filter Event Data Reports

Event Data Reportsnavigation: Analytics > Event Data Reportsallow you to view reports of event activity. You can filter reports using audience rules similar to event dashboard charts.

Use case: You could filter by a saved audience rule where the contact has placed an order in the past 30 days.

 

In the next article, you can learn about supplements.

Comments

0 comments

Please sign in to leave a comment.