---
schema_version: "1"
id: 419c6de3ddaa4cf130f9a2f960a06f4b64f2bef3c513f5d59858960d1745ada3
title: Capture Engagement Data (Version 2.x)
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-capturing-engagement-data-v2.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-capturing-engagement-data-v2.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: de8f42ccbd88e0fa9ab4b3fad607140baa82dfea3f225c25b7bf944c5fb04efd
products:
  - Data 360 Engagement Mobile SDK
  - Data 360 Developer Documentation
---
# Capture Engagement Data (Version 2.x)

The Data 360 Module for the Engagement Mobile SDK enables the collection of rich engagement data from customer interactions within your mobile application through event tracking.

## Prerequisites

Before engagement data can be sent to Data 360:

- The Data 360 Module for the Engagement Mobile SDK must be configured and [initialized](https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-initialization.md).
- [Consent](https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-consent-management.md) to track engagement data must be granted.

## Supported Event Types

The Engagement Mobile SDK supports two types of events — structured and unstructured events. Both event types are collected using the `SFMCSdk.track(event)` function.

### Structured Events

Structured events have predefined schemas with strict data requirements. They come pre-configured with the Mobile Connector schema for Data 360 and can be extended to capture additional custom data. The Data 360 Module supports the following structured events.

- Cart Event: Track shopping cart interactions
- Catalog Event: Monitor product catalog engagement
- Order Event: Capture purchase and order data

### Unstructured Events

Unstructured events have no predefined data requirements. You must create and add custom event definitions to the Mobile Connector schema for Data 360 ingestion.

## Implementation Examples

```
import SFMCSDK
import Cdp

...

// collecting the structured AddToCartEvent
SFMCSdk.track(AddToCartEvent(
    lineItem: LineItem(
        catalogObjectType: "Product",
        catalogObjectId: "product-1",
        quantity: 1,
        price: 20.0,
        currency: "USD",
        // attributes can contain any custom field data
        // as long as the schema is modified to define them
        attributes: [
            "gift_wrap": false
        ]
    )
))

// collecting an unstructured CustomEvent
SFMCSdk.track(CustomEvent(
    name: "CartAbandonment",
    attributes: [
        "sku": "COFFEE-NTR-06",
        "price": 19.99
    ]
))
```

### Android

```
import com.salesforce.marketingcloud.sfmcsdk.components.events.CartEvent
import com.salesforce.marketingcloud.sfmcsdk.components.events.EventManager
import com.salesforce.marketingcloud.sfmcsdk.SFMCSdk

...

// collecting the structured AddToCartEvent
SFMCSdk.track(CartEvent.add(
    lineItem = LineItem(
        catalogObjectId = "product-1",
        catalogObjectType = "Product",
        quantity = 1,
        price = 20.0,
        currency = "USD",
        // attributes can contain any custom field data
        // as long as the schema is modified to define them
        attributes = mapOf(
            "gift_wrap" to false
        )
    )
))

// collecting an unstructured CustomEvent
SFMCSdk.track(EventManager.customEvent(
    "CartAbandonment",
    mapOf(
        "sku" to "COFFEE-NTR-06",
        "price" to 19.99
    )
))
```
