Cart Abandonment

This page explains how to send a reminder notification to customers who have added an item to their cart and left it. You can use Oracle Infinity to generate this action.

The following diagram gives a top-level overview of what needs to be done.

This following diagram gives a top-level overview of what needs to be done.

Step 1: Integrate the CX Core Module

Learn more about integrating the mobile SDK here.

Step 2: Raise the Added to Cart event

Add a retargeting event that tracks when a user adds an item to their cart. The code should resemble the following example.

iOS

See the iOS retargeting page for more information.

[[PushIOManager sharedInstance] trackEvent:@"$AddedItemToCart" withAttributes:@{ @"Pid": @"123", @"Pc": @"Shoes" }]
PushIOManager.sharedInstance().trackEvent("$AddedItemToCart", properties: ["Pid": "123", "Pc":"Shoes"])

Android

See the Android retargeting page for more information.

// Define retargeting event properties
Map<String, Object> eventProperties = new HashMap<>();

// For example

eventProperties.put("Pid", "123");
eventProperties.put("Pc", "Shoes");

// Report the retargeting Event
PushIOManager.getInstance(this).trackEvent("$AddedItemToCart", eventProperties);						

Step 3: Define the retargeting action

There are two potential use cases:

  1. The user is not logged in
  2. The user is logged in

User is not logged in (Responsys REST connection)

1. Set your Responsys connection. Go to the Action Center and click "Manage Connections".

The Manage Connections button is highlighted

2. Click "New Connection" and choose "Responsys REST" from the dropdown menu. Enter a name for your connection and enter in your pod, username and password. See the Responsys REST API documentation for more details.

The Connect to Responsys REST page is displayed

3. Next you will set the target for your connection. Click on your new connection and click "New" beside "Destinations." Set the method to "Push Trigger." Give your destination a name and fill in the push campaign you wish to send.

Under "Visitor Id Mapping Setting," set "Device ID" to DEVICE_ID and "API Key" to API_KEY. Since the user is not logged in, this is the only data we will have access to.

The Create a Destination for Responsys REST is displayed

4. Now you can define the query that will define when the action gets triggered. Go to the Streams lab. In the "Select" bar, fill in:

* WHERE data.rsys.eventname = '$AddedItemToCart' AND data.rsys.eventname != '$PurchasedCart' AND session.closed='true'

Click start and drag rsys.data.deviceid and rsys.data.apikey into the canvas. Save the stream.

5. Now you can set the action to be taken. Go back to the Action Center and click "Create Action." Set a name and description and select the connection and destination you defined earlier.

Now choose the query from the stream you just saved. Under "Send," set data.rsys.apikey to API_KEY and data.rsys.deviceid to DEVICE_ID.

The Data page is displayed

Click save and start running the action.

User is logged in (Responsys connection)

1. Run the following code in the SDK with your account's email address:

PushIOManager.sharedInstance().registerUserID("asdf@oracle.com")

2. Set your Responsys connection. Go to the Action Center and click "Manage Connections".

The Manage Connections button is highlighted

3. Click "New Connection" and choose "Responsys" from the dropdown menu. Enter a name for your connection and enter in your login and endpoint. You can drag and drop your authentication certificate file or click to select from your system. See the Responsys REST API documentation for more details.

4. Next you will set the target for your connection. Click on your new connection and click "New" beside "Destinations." Set the format to "Custom Event" and fill out the required information. Set "Event Key Value" to USERID and set "Responsys Key" to "Email Address."

5. Now you can define the query that will define when the action gets triggered. Go to the Streams lab. In the "Select" bar, fill in:

* WHERE data.rsys.eventname = '$AddedItemToCart' AND data.rsys.eventname != '$PurchasedCart' AND session.closed='true'

Click start and drag rsys.data.userid and rsys.data.name into the canvas. Save the stream.

6. Now you can set the action to be taken. Go back to the Action Center and click "Create Action." Set a name and description and select the connection and destination you defined earlier.

Now choose the query from the stream you just saved. Under "Send," set data.rsys.userid to USERID and data.rsys.name to EVENTNAME.

Click save and start running the action.

Step 4: Verify the Event in Infinity Streams

Within your app, emulate the cart abandonment action, where the user adds an item to their cart and abandons it. The user should then receive a message. Verify the $AddedItemToCart event is reached in Infinity Streams (when the mobile app raises the $AddedItemToCart event) along with the DeviceID and APIKey.