Oracle Infinity Analytics for Android
This is a guide for Oracle CX (OCX) Responsys mobile SDK users to integrate and use the events and reporting capabilities of the OCX Infinity Analytics mobile SDK. This guide will highlight the integration of OCX Infinity Analytics mobile SDK for sending the following events to OCX Infinity Analytics:
-
Application Lifecycle Events
-
Conversion Events
-
Cart Transaction Events
-
Real Time Event Sync
In this topic:
Getting Started
For the analytics methods mentioned in this topic, the following SDKs are required to be added to your app:
Place these SDKs in the libs directory of your Android Studio project.
Application Lifecycle Events
Application state may be tracked automatically or manually via the helpers methods available in the OCX Core module. Refer to this guide for more details.
Conversion Events
Use the following method for tracking push conversions:
Map<String, String> triggerConversionEvent(final ORAEventMeta eventMeta, final String contentGroup, final String conversionName);
Parameters
-
eventMeta
: Specifies an<ORAEventMeta>
object that stores common parameter types attached to this event.-
eventPath
: Specifies the hierarchical representation of an application view at the time of the event. For example, this parameter can specify an application path. -
eventDesc
: Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen. -
eventType
: Specifies the type of event that occurred, such as a view or click. -
customData
(optional): Specifies a series of custom name-value parameters used to pass data that is not included in the method.
-
-
contentGroup
(optional): Specifies a group of related application views. -
conversionName
: Specifies the name used to identify a customer conversion.
Example
// Send custom key/value pairs as arguments to event methods (optional)
Map <String, String> customData = new HashMap<String, String>();
customData.put("rsys.deviceId", deviceId); // required
customData.put("rsys.apiKey", apiKey); // required
customData.put("product_name", "Nike-Jordan"); //required
customData.put("product_category", "Footwear"); //required
customData.put("product_brand", "Nike"); //required
customData.put("custom_key", "custom_value");
final ORAEventMeta eventMeta = new ORAEventMeta("/HelloWorld/conversion/event", "HelloWorld Conversion Event", "event", customData);
ORADataCollector.getInstance().triggerConversionEvent(eventMeta, "Content Group", "Conversion Name");
Important: In the above example, the key/value pairs rsys.deviceid
and rsys.apikey
are mandatory. These can be accessed using the methods below.
PushIOManager.getInstance(context).getDeviceId();
PushIOManager.getInstance(context).getAPIKey();
Cart Transaction Events
Use the following method to track cart-related events:
Map<String, String> triggerCartTransactionEvent(final ORAEventMeta eventMeta, final ORAProductMeta productMeta, final String contentGroup, final String invoiceNumber);
Parameters
-
eventMeta
: Specifies an<ORAEventMeta>
object that stores common parameter types attached to this event.-
eventDesc
: Specifies the representation of an application view at the time of the event. For example, this parameter can specify the name of a screen. -
eventType
: Specifies the type of event that occurred, such as a view or click. -
customData
(optional): Specifies a series of custom name-value parameters used to pass data that is not included in the method.
-
-
productMeta
: Specifies an<ORAProductMeta>
object that stores product specific common parameters attached to this event.-
productType
: Specifies a product identifier (always "p"). -
productIds
(optional): Specifies a product identifier. -
productSkus
: Specifies a unique product stock-keeping unit (SKU) number. -
productUnits
: Specifies a product number. -
productSubtoTals
: Specifies a product subtotal price (units * price).
-
-
contentGroup
: Specifies a group of related application views.
Example
/ Send custom key/value pairs as arguments to event methods (optional)
Map <String, String> customData = new HashMap<String, String>();
customData.put("rsys.deviceId", deviceId); // required
customData.put("rsys.apiKey", apiKey); // required
customData.put("product_name", "Nike-Jordan"); //required
customData.put("product_category", "Footwear"); //required
customData.put("product_brand", "Nike"); //required
customData.put("custom_key", "custom_value");
final ORAEventMeta eventMeta = new ORAEventMeta("/HelloWorld/product/view", "HelloWorld Cart Transaction", "view", customData);
final String[] productIds = {"productId1, productId2"};
final String[] productSkus = {productSku1, productSku2};
final String[] productUnits = {"5", "4"};
final String[] productSubTotals = {"45.00", "8.25"};
final ORAProductMeta productMeta= new ORAProductMeta("p", productIds,
productSkus, productUnits, productSubTotals)
ORADataCollector.getInstance().triggerCartTransactionEvent(eventMeta, productMeta, "Content Group",
"invoiceNumber");
Important: In the above example, the key/value pairs rsys.deviceid
and rsys.apikey
are mandatory. These can be accessed using the methods below.
PushIOManager.getInstance(context).getDeviceId();
PushIOManager.getInstance(context).getAPIKey();
Real Time Event Sync
To sync the events in real time, the following configuration in Infinity Analytics SDK can be implemented.
ORAInfinityDataContainer container = new ORAInfinityDataContainer(this);
container.putValue(ORABaseConfigSettings.SEND_INTERVAL_MILLIS, "1");