Experience Events

XDM Schema

The Experience Platform extension can send events that follow a previously defined XDM schema to Adobe Experience Platform.

For more information about the Experience Data Model (XDM), see The Experience Business speaks one Language: XDM.

To learn how to create a schema, see Create a schema using the Schema Editor.

XDM events

The Experience Platform Mobile extension exposes public APIs so that you can create custom events with the following structure:

Data

Description

Timestamp

(Required) The auto generated timestamp when the Experience Platform event is sent through the Experience Platform Mobile SDK to the Adobe solutions you have enabled and Experience Platform.

Event ID

(Required) Unique event identifier that is auto generated by the Mobile SDK.

Event type

(Required) The event type, for example commerce:orderDetails.

XDM data

(Required) Data following the XDM schema that is defined in the Schema Editor.

Event metadata

(Optional) Solution specific metadata, such as identity or personalization metadata.

Event query

(Optional) For each event override, the server side decision settings, such as identity or personalization query.

Data

(Optional) The JSON-formatted, free-form data that can be associated with an event.

Event merge ID

(Optional) An identifier that correlates, or merges, multiple Experience Platform events that are essentially the same event or should be merged. This data should be populated by the data producer before ingestion.

This extension provides public APIs to build the Experience Platform events; these events should not be confused with the events that are built by using the Mobile Core (Android) / ACPCore (iOS) extension.

The Experience Platform extension provides the following interfaces:

  • Schema

  • Property

By using the Experience Platform Mobile extension, the Schema interface can be used to define the classes that are associated with your defined schema in Adobe Experience Platform.

Android
iOS
Android
/**
* The interface that represents an Experience Platform XDM event data schema.
*/
public interface Schema {
/**
* Returns the version of this schema as defined in the Adobe Experience Platform.
* @return the version of this schema.
*/
String getSchemaVersion();
/**
* Returns the identifier for this schema as defined in the Adobe Experience Platform.
* The identifier is a URI where this schema is defined.
* @return the URI identifier for this schema.
*/
String getSchemaIdentifier();
/**
* Serialize this {@code Schema} object to a map with the same format as its XDM schema.
* @return the XDM-formatted map of this {@code Schema} object.
*/
Map<String, Object> serializeToXdm();
}

By implementing the Property interface, you can define complex properties for your XDM Schema. A complex property is defined as not being a primitive type, string, or date.

public interface Property {
/**
* Serialize this {@code Property} object to a map with the same format as its XDM schema.
* @return XDM-formatted map of this {@code Property} object.
*/
Map<String, Object> serializeToXdm();
}
iOS
import Foundation
/// An protocol representing a Platform XDM Event Data schema.
public protocol XDMSchema: Encodable {
/// Returns the version of this schema as defined in the Adobe Experience Platform.
/// - Returns: The version of this schema
var schemaVersion: String { get }
/// Returns the identifier for this schema as defined in the Adobe Experience Platform.
/// The identifier is a URI where this schema is defined.
/// - Returns: The URI identifier for this schema
var schemaIdentifier: String { get }
/// Returns the identifier for this dataset as defined in the Adobe Experience Platform.
/// This is a system generated identifier for the Dataset the event belongs to.
/// - Returns: The identifier as a String for this dataset
var datasetIdentifier: String { get }
}
extension XDMSchema {
func toJSONData() -> Data? {
try? JSONEncoder().encode(self)
}
}

By implementing this XDMSchema protocol, you can define complex properties for your XDM Schema. A complex property is defined as not being a fundamental type (Int, Float, Double, Bool or String), or Date.

When defining your custom XDM Schemas, to ensure that the Experience Platform extension successfully serializes the provided data before sending it to Adobe solutions and Experience Platform, implement these interfaces.

In this alpha release, the Mobile SDK provides predefined classes of the XDM Schema for commerce events in the new xdmlib library.