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,
mobileAppEventis a sample name parameter value. Set thenameparameter to a value that matches thedeveloperNamedefined in your Custom Event Schema in Data 360.
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.
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
)
)
)
)