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 XDM System overview.

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.

Data

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

Dataset ID

(Optional) Using the Experience Platform mobile extension, you can send data to multiple datasets based on your needs and configuration in Adobe Experience Platform. When sending an Experience event and providing a dataset identifier, the dataset ID will be used for redirecting the data to the specified AEP Dataset instead of the default dataset set in the Experience Edge Configuration.

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.

Android
iOS
Android

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.

/**
* 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();
/**
* Returns the identifier for this dataset as defined in the Adobe Experience Platform.
* @return the dataset ID
*/
String getDatasetIdentifier();
/**
* 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

The Experience Platform extension provides the following protocol:

  • XDMSchema

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

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.