---
schema_version: "1"
id: bb2058f35783f8efb40bbb5a2692a831bd7e1f2b5e6f0c213b52d63605fba3a4
title: Custom Event Schema
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-engagement-mobile-sdk/guides/c360a-api-engagement-mobile-sdk-custom-event-schema.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-custom-event-schema.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4e82a49f0a05f1b5b03b8c4fd2a167a4405f147a3f0a4c2f648d1267f617cadb
products:
  - Data 360 Engagement Mobile SDK
  - Data 360 Developer Documentation
---
# Custom Event Schema

Use the event data models provided by the Engagement Mobile SDK for cart event, catalog event, and order event to use the unified data model across Salesforce. You can create and capture a custom event.

Define the custom event in the Mobile Connector schema:

| Source Event Property                                              | Target Schema Developer Name                           | Field Type      | Description                                                                                                                                                  | CIM Object / Attribute |
| ------------------------------------------------------------------ | ------------------------------------------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------- |
| \<Automatically Assigned>                                          | `eventId`                                              | text            | **Required**. Typically, the primary key for the engagement events.                                                                                          | -                      |
| \<Automatically Assigned>                                          | `dateTime`                                             | dateTime        | **Required**. Used for data partitioning for engagement events. ISO8601 supported format.                                                                    | -                      |
| `name`                                                             | `eventType = <what the user defined in name property>` | text            | **Required**. The name defined in property suffixed with `eventType`. For example, the name `Custom Event` is transformed to: `"eventType": "Custom Event"`. | -                      |
| \<Automatically Assigned>                                          | `sessionId`                                            | text            | **Required**. The identifier of the session.                                                                                                                 | -                      |
| \<Automatically Assigned>                                          | `deviceId`                                             | text            | **Required**. Typically, the primary key for profile events.                                                                                                 | -                      |
| \<Automatically Assigned>                                          | `category = "Engagement"`                              | text            | **Required**. Possible values are: <ul><li>`Engagement`</li><li>`Profile`</li></ul>                                                                          | -                      |
| \<Automatically Assigned>                                          | `channel = "mobile"`                                   | text            | The SDK event channel. For Engagement Mobile SDK the value is `mobile`.                                                                                      | -                      |
| \<user defined attributes array>                                   | \<attributes as defined by user>                       | \<user defined> | [Custom Event](https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-custom-event.md). **Note**: Attributes array can contain nested arrays.                                       | -                      |
| \<Automatically Assigned when <a>Location Tracking</a> is allowed> | `longitude`                                            | number          | The longitudinal coordinate in decimal degrees reported by the device at the time the event was captured.                                                    | Device Longitude       |
| \<Automatically Assigned when <a>Location Tracking</a> is allowed> | `latitude`                                             | number          | The latitudinal coordinate in decimal degrees reported by the device at the time the event was captured.                                                     | Device Latitude        |

If `eventType` isn’t provided but `name` is then `eventType` defaults to the value of name. For example, the schema could look like:

```nolang
{
  "masterLabel": "CustomEvent",
  "developerName": "Custom Event",
  "category": "Engagement",
  "externalDataTranFields": [
    {
      "masterLabel": "category",
      "developerName": "category",
      "dataType": "Text",
      "isDataRequired": true
    },
    {
      "masterLabel": "channel",
      "developerName": "channel",
      "dataType": "Text",
      "isDataRequired": false
    },
    {
      "masterLabel": "dateTime",
      "developerName": "dateTime",
      "dataType": "DateTime",
      "isDataRequired": true
    },
    {
      "masterLabel": "deviceId",
      "developerName": "deviceId",
      "dataType": "Text",
      "isDataRequired": true,
      "primaryIndexOrder": 1
    },
    {
      "masterLabel": "eventId",
      "developerName": "eventId",
      "dataType": "Text",
      "isDataRequired": true
    },
    {
      "masterLabel": "eventType",
      "developerName": "eventType",
      "dataType": "Text",
      "isDataRequired": true
    },
    {
      "masterLabel": "latitude",
      "developerName": "latitude",
      "dataType": "Number",
      "isDataRequired": false
    },
    {
      "masterLabel": "longitude",
      "developerName": "longitude",
      "dataType": "Number",
      "isDataRequired": false
    },
    {
      "masterLabel": "sessionId",
      "developerName": "sessionId",
      "dataType": "Text",
      "isDataRequired": true
    },
    {
      "masterLabel": "giftMessage",
      "developerName": "giftMessage",
      "dataType": "Text",
      "isDataRequired": false
    },
    {
      "masterLabel": "giftWrap",
      "developerName": "giftWrap",
      "dataType": "Text",
      "isDataRequired": false
    },
    {
      "masterLabel": "giftWrapOptionsPaperColor",
      "developerName": "giftOptionsPaperColor",
      "dataType": "Text",
      "isDataRequired": false
    },
    {
      "masterLabel": "giftWrapOptionsRibbon",
      "developerName": "giftOptionsRibbon",
      "dataType": "bool",
      "isDataRequired": false
    }
  ]
}
```
