---
schema_version: "1"
id: 8a441c6be4593378cbc76c52e1c53ac015db16e0ddc0846db5e574e6214272d0
title: Custom Event (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-custom-event-v2.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-custom-event-v2.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f8c9aba336d389652609a8fdcd2e6b7889148d3dd42e15e7ebef6fe240623327
products:
  - Data 360 Engagement Mobile SDK
  - Data 360 Developer Documentation
---
# Custom Event (Version 2.x)

A custom event lets you track unique user interactions and send data that isn't covered by standard events. You can include a flexible payload of user-defined attributes to capture the specific details of an interaction. You can then map these attributes to a Custom Event Schema in Data 360 using the Mobile Schema naming conventions.

## Custom Event Example for iOS

Here's an example of a custom event that captures a user's gift preferences.

> **Note:** In this example, `mobileAppEvent` is a sample name parameter value. Set the `name` parameter to a value that matches the `developerName` defined in your [Custom Event Schema](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-mobile-web-sdk-schema-quick-guide.html#event) in Data 360.

```nolang
CustomEvent(
    name: "mobileAppEvent",
    attributes: [
        "giftWrap" : true,
        "giftMessage" : "Happy Birthday",
        "giftWrapOptions": [
            "paperColor": "green",
            "ribbon": false
  ]
    ]
)
```

## Custom Event Example for Android

Here's an example showing the same custom event for capturing a user's gift preferences on Android.

```nolang
EventManager.customEvent(
    name = "mobileAppEvent",
    attributes = mapOf(
        "gift" to mapOf(
            "message" to "Happy Birthday",
            "wrap" to true,
            "wrapOptions" to mapOf(
                "paper-color" to "green",
                "ribbon" to false
            )
        )
    )
)
```
