Checkout Options
Mobile checkout example with oneOf, anyOf, and platform-specific conditional fields using flat Firebase-compatible params.
DataLayer Examples
- Android Firebase (Kotlin)
- Android Firebase (Java)
- iOS Firebase (Swift)
- iOS Firebase (Obj-C)
identity_type options:
- Logged-In User
- Guest User
firebaseAnalytics.logEvent("checkout_options_selected") {
param("platform", "ios")
param("identity_type", "logged_in")
param("identity_user_id", "user-123")
param("identity_session_id", "sess-789")
param("contact_channel", "email")
param("contact_email", "buyer@example.com")
param("contact_push_token", "token_abc123")
param("att_status", "authorized")
param("ad_personalization_enabled", 1L)
}
firebaseAnalytics.logEvent("checkout_options_selected") {
param("platform", "ios")
param("identity_type", "guest")
param("identity_user_id", "user-123")
param("identity_session_id", "sess-789")
param("contact_channel", "email")
param("contact_email", "buyer@example.com")
param("contact_push_token", "token_abc123")
param("att_status", "authorized")
param("ad_personalization_enabled", 1L)
}
contact_channel options:
- Email Updates
- Push Updates
firebaseAnalytics.logEvent("checkout_options_selected") {
param("platform", "ios")
param("identity_type", "logged_in")
param("identity_user_id", "user-123")
param("identity_session_id", "sess-789")
param("contact_channel", "email")
param("contact_email", "buyer@example.com")
param("contact_push_token", "token_abc123")
param("att_status", "authorized")
param("ad_personalization_enabled", 1L)
}
firebaseAnalytics.logEvent("checkout_options_selected") {
param("platform", "ios")
param("identity_type", "logged_in")
param("identity_user_id", "user-123")
param("identity_session_id", "sess-789")
param("contact_channel", "push")
param("contact_email", "buyer@example.com")
param("contact_push_token", "token_abc123")
param("att_status", "authorized")
param("ad_personalization_enabled", 1L)
}
conditional options:
- When condition is met
- When condition is not met
firebaseAnalytics.logEvent("checkout_options_selected") {
param("platform", "ios")
param("identity_type", "logged_in")
param("identity_user_id", "user-123")
param("identity_session_id", "sess-789")
param("contact_channel", "email")
param("contact_email", "buyer@example.com")
param("contact_push_token", "token_abc123")
param("att_status", "authorized")
}
firebaseAnalytics.logEvent("checkout_options_selected") {
param("platform", "ios")
param("identity_type", "logged_in")
param("identity_user_id", "user-123")
param("identity_session_id", "sess-789")
param("contact_channel", "email")
param("contact_email", "buyer@example.com")
param("contact_push_token", "token_abc123")
param("ad_personalization_enabled", 1L)
}
identity_type options:
- Logged-In User
- Guest User
Bundle eventParams = new Bundle();
eventParams.putString("platform", "ios");
eventParams.putString("identity_type", "logged_in");
eventParams.putString("identity_user_id", "user-123");
eventParams.putString("identity_session_id", "sess-789");
eventParams.putString("contact_channel", "email");
eventParams.putString("contact_email", "buyer@example.com");
eventParams.putString("contact_push_token", "token_abc123");
eventParams.putString("att_status", "authorized");
eventParams.putLong("ad_personalization_enabled", 1L);
mFirebaseAnalytics.logEvent("checkout_options_selected", eventParams);
Bundle eventParams = new Bundle();
eventParams.putString("platform", "ios");
eventParams.putString("identity_type", "guest");
eventParams.putString("identity_user_id", "user-123");
eventParams.putString("identity_session_id", "sess-789");
eventParams.putString("contact_channel", "email");
eventParams.putString("contact_email", "buyer@example.com");
eventParams.putString("contact_push_token", "token_abc123");
eventParams.putString("att_status", "authorized");
eventParams.putLong("ad_personalization_enabled", 1L);
mFirebaseAnalytics.logEvent("checkout_options_selected", eventParams);
contact_channel options:
- Email Updates
- Push Updates
Bundle eventParams = new Bundle();
eventParams.putString("platform", "ios");
eventParams.putString("identity_type", "logged_in");
eventParams.putString("identity_user_id", "user-123");
eventParams.putString("identity_session_id", "sess-789");
eventParams.putString("contact_channel", "email");
eventParams.putString("contact_email", "buyer@example.com");
eventParams.putString("contact_push_token", "token_abc123");
eventParams.putString("att_status", "authorized");
eventParams.putLong("ad_personalization_enabled", 1L);
mFirebaseAnalytics.logEvent("checkout_options_selected", eventParams);
Bundle eventParams = new Bundle();
eventParams.putString("platform", "ios");
eventParams.putString("identity_type", "logged_in");
eventParams.putString("identity_user_id", "user-123");
eventParams.putString("identity_session_id", "sess-789");
eventParams.putString("contact_channel", "push");
eventParams.putString("contact_email", "buyer@example.com");
eventParams.putString("contact_push_token", "token_abc123");
eventParams.putString("att_status", "authorized");
eventParams.putLong("ad_personalization_enabled", 1L);
mFirebaseAnalytics.logEvent("checkout_options_selected", eventParams);
conditional options:
- When condition is met
- When condition is not met
Bundle eventParams = new Bundle();
eventParams.putString("platform", "ios");
eventParams.putString("identity_type", "logged_in");
eventParams.putString("identity_user_id", "user-123");
eventParams.putString("identity_session_id", "sess-789");
eventParams.putString("contact_channel", "email");
eventParams.putString("contact_email", "buyer@example.com");
eventParams.putString("contact_push_token", "token_abc123");
eventParams.putString("att_status", "authorized");
mFirebaseAnalytics.logEvent("checkout_options_selected", eventParams);
Bundle eventParams = new Bundle();
eventParams.putString("platform", "ios");
eventParams.putString("identity_type", "logged_in");
eventParams.putString("identity_user_id", "user-123");
eventParams.putString("identity_session_id", "sess-789");
eventParams.putString("contact_channel", "email");
eventParams.putString("contact_email", "buyer@example.com");
eventParams.putString("contact_push_token", "token_abc123");
eventParams.putLong("ad_personalization_enabled", 1L);
mFirebaseAnalytics.logEvent("checkout_options_selected", eventParams);
identity_type options:
- Logged-In User
- Guest User
var eventParams: [String: Any] = [
"platform": "ios",
"identity_type": "logged_in",
"identity_user_id": "user-123",
"identity_session_id": "sess-789",
"contact_channel": "email",
"contact_email": "buyer@example.com",
"contact_push_token": "token_abc123",
"att_status": "authorized",
"ad_personalization_enabled": 1
]
Analytics.logEvent("checkout_options_selected", parameters: eventParams)
var eventParams: [String: Any] = [
"platform": "ios",
"identity_type": "guest",
"identity_user_id": "user-123",
"identity_session_id": "sess-789",
"contact_channel": "email",
"contact_email": "buyer@example.com",
"contact_push_token": "token_abc123",
"att_status": "authorized",
"ad_personalization_enabled": 1
]
Analytics.logEvent("checkout_options_selected", parameters: eventParams)
contact_channel options:
- Email Updates
- Push Updates
var eventParams: [String: Any] = [
"platform": "ios",
"identity_type": "logged_in",
"identity_user_id": "user-123",
"identity_session_id": "sess-789",
"contact_channel": "email",
"contact_email": "buyer@example.com",
"contact_push_token": "token_abc123",
"att_status": "authorized",
"ad_personalization_enabled": 1
]
Analytics.logEvent("checkout_options_selected", parameters: eventParams)
var eventParams: [String: Any] = [
"platform": "ios",
"identity_type": "logged_in",
"identity_user_id": "user-123",
"identity_session_id": "sess-789",
"contact_channel": "push",
"contact_email": "buyer@example.com",
"contact_push_token": "token_abc123",
"att_status": "authorized",
"ad_personalization_enabled": 1
]
Analytics.logEvent("checkout_options_selected", parameters: eventParams)
conditional options:
- When condition is met
- When condition is not met
var eventParams: [String: Any] = [
"platform": "ios",
"identity_type": "logged_in",
"identity_user_id": "user-123",
"identity_session_id": "sess-789",
"contact_channel": "email",
"contact_email": "buyer@example.com",
"contact_push_token": "token_abc123",
"att_status": "authorized"
]
Analytics.logEvent("checkout_options_selected", parameters: eventParams)
var eventParams: [String: Any] = [
"platform": "ios",
"identity_type": "logged_in",
"identity_user_id": "user-123",
"identity_session_id": "sess-789",
"contact_channel": "email",
"contact_email": "buyer@example.com",
"contact_push_token": "token_abc123",
"ad_personalization_enabled": 1
]
Analytics.logEvent("checkout_options_selected", parameters: eventParams)
identity_type options:
- Logged-In User
- Guest User
NSMutableDictionary *eventParams = [@{
@"platform": @"ios",
@"identity_type": @"logged_in",
@"identity_user_id": @"user-123",
@"identity_session_id": @"sess-789",
@"contact_channel": @"email",
@"contact_email": @"buyer@example.com",
@"contact_push_token": @"token_abc123",
@"att_status": @"authorized",
@"ad_personalization_enabled": @(1)
} mutableCopy];
[FIRAnalytics logEventWithName:@"checkout_options_selected" parameters:eventParams];
NSMutableDictionary *eventParams = [@{
@"platform": @"ios",
@"identity_type": @"guest",
@"identity_user_id": @"user-123",
@"identity_session_id": @"sess-789",
@"contact_channel": @"email",
@"contact_email": @"buyer@example.com",
@"contact_push_token": @"token_abc123",
@"att_status": @"authorized",
@"ad_personalization_enabled": @(1)
} mutableCopy];
[FIRAnalytics logEventWithName:@"checkout_options_selected" parameters:eventParams];
contact_channel options:
- Email Updates
- Push Updates
NSMutableDictionary *eventParams = [@{
@"platform": @"ios",
@"identity_type": @"logged_in",
@"identity_user_id": @"user-123",
@"identity_session_id": @"sess-789",
@"contact_channel": @"email",
@"contact_email": @"buyer@example.com",
@"contact_push_token": @"token_abc123",
@"att_status": @"authorized",
@"ad_personalization_enabled": @(1)
} mutableCopy];
[FIRAnalytics logEventWithName:@"checkout_options_selected" parameters:eventParams];
NSMutableDictionary *eventParams = [@{
@"platform": @"ios",
@"identity_type": @"logged_in",
@"identity_user_id": @"user-123",
@"identity_session_id": @"sess-789",
@"contact_channel": @"push",
@"contact_email": @"buyer@example.com",
@"contact_push_token": @"token_abc123",
@"att_status": @"authorized",
@"ad_personalization_enabled": @(1)
} mutableCopy];
[FIRAnalytics logEventWithName:@"checkout_options_selected" parameters:eventParams];
conditional options:
- When condition is met
- When condition is not met
NSMutableDictionary *eventParams = [@{
@"platform": @"ios",
@"identity_type": @"logged_in",
@"identity_user_id": @"user-123",
@"identity_session_id": @"sess-789",
@"contact_channel": @"email",
@"contact_email": @"buyer@example.com",
@"contact_push_token": @"token_abc123",
@"att_status": @"authorized"
} mutableCopy];
[FIRAnalytics logEventWithName:@"checkout_options_selected" parameters:eventParams];
NSMutableDictionary *eventParams = [@{
@"platform": @"ios",
@"identity_type": @"logged_in",
@"identity_user_id": @"user-123",
@"identity_session_id": @"sess-789",
@"contact_channel": @"email",
@"contact_email": @"buyer@example.com",
@"contact_push_token": @"token_abc123",
@"ad_personalization_enabled": @(1)
} mutableCopy];
[FIRAnalytics logEventWithName:@"checkout_options_selected" parameters:eventParams];
Event Properties
| Property | Type | Constraints | Examples | Description |
|---|---|---|---|---|
| $schema | string | required | | Defines the structure of the event. |
const: "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/checkout-options-event.json" | ||||
| event | string | required | | The event name for checkout option selection. |
const: "checkout_options_selected" | ||||
| platform | string | required | | App platform. |
enum: [ios, android] | ||||
identity_type - Select one of the following options:Identity mode for the user. | ||||
| identity_type | string | required | | |
const: "logged_in" | ||||
| identity_user_id | string | | Authenticated user ID. | |
| identity_session_id | string | | Anonymous checkout session ID. | |
contact_channel - Select any of the following options:How checkout updates should be delivered. | ||||
| contact_email | string | format: email | | Email address used for checkout updates. |
| contact_push_token | string | | Device push token used for checkout updates. | |
| att_status | string | enum: [authorized, denied, not_determined] | | App Tracking Transparency status on iOS. |
| ad_personalization_enabled | boolean | | Whether ad personalization is enabled on Android. | |
additionalPropertiesSchema constraintControls properties not listed in properties and not matched by patternProperties. | string, number, integer, boolean, null | |||
| If | ||||
| platform | object | required | | |
const: "ios" | ||||
| att_status | string | required | | App Tracking Transparency status on iOS. |
enum: [authorized, denied, not_determined] | ||||
View Raw JSON Schema
{
: "https://json-schema.org/draft/2020-12/schema",
: "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/checkout-options-event.json",
: "checkoutOptionsEvent",
: "Metadata example for the schema JSON viewer on a mobile event schema.",
"title": "Checkout Options",
"description": "Mobile checkout example with oneOf, anyOf, and platform-specific conditional fields using flat Firebase-compatible params.",
"x-tracking-targets": [
"android-firebase-kotlin-sdk",
"android-firebase-java-sdk",
"ios-firebase-swift-sdk",
"ios-firebase-objc-sdk"
],
"type": "object",
"allOf": [
{
"$ref": "https://tracking-docs-demo.buchert.digital/constraints/schemas/firebase/v1/flat-event-params.json"
},
{
"if": {
"properties": {
"platform": {
"const": "ios"
}
},
"required": [
"platform"
]
},
"then": {
"required": [
"att_status"
]
},
"else": {
"required": [
"ad_personalization_enabled"
]
}
},
{
"if": {
"properties": {
"identity_type": {
"const": "logged_in"
}
},
"required": [
"identity_type"
]
},
"then": {
"required": [
"identity_user_id"
]
},
"else": {
"required": [
"identity_session_id"
]
}
},
{
"if": {
"properties": {
"contact_channel": {
"const": "email"
}
},
"required": [
"contact_channel"
]
},
"then": {
"required": [
"contact_email"
]
},
"else": {
"required": [
"contact_push_token"
]
}
}
],
"properties": {
"$schema": {
"type": "string",
"description": "Defines the structure of the event.",
"const": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/checkout-options-event.json"
},
"event": {
"type": "string",
"const": "checkout_options_selected",
"description": "The event name for checkout option selection."
},
"platform": {
"type": "string",
"description": "App platform.",
"enum": [
"ios",
"android"
],
"examples": [
"ios"
]
},
"identity_type": {
"description": "Identity mode for the user.",
"oneOf": [
{
"title": "Logged-In User",
"type": "string",
"const": "logged_in",
"examples": [
"logged_in"
]
},
{
"title": "Guest User",
"type": "string",
"const": "guest",
"examples": [
"guest"
]
}
]
},
"identity_user_id": {
"type": "string",
"description": "Authenticated user ID.",
"examples": [
"user-123"
]
},
"identity_session_id": {
"type": "string",
"description": "Anonymous checkout session ID.",
"examples": [
"sess-789"
]
},
"contact_channel": {
"description": "How checkout updates should be delivered.",
"anyOf": [
{
"title": "Email Updates",
"type": "string",
"const": "email",
"examples": [
"email"
]
},
{
"title": "Push Updates",
"type": "string",
"const": "push",
"examples": [
"push"
]
}
]
},
"contact_email": {
"type": "string",
"format": "email",
"description": "Email address used for checkout updates.",
"examples": [
"buyer@example.com"
]
},
"contact_push_token": {
"type": "string",
"description": "Device push token used for checkout updates.",
"examples": [
"token_abc123"
]
},
"att_status": {
"type": "string",
"description": "App Tracking Transparency status on iOS.",
"enum": [
"authorized",
"denied",
"not_determined"
],
"examples": [
"authorized"
]
},
"ad_personalization_enabled": {
"type": "boolean",
"description": "Whether ad personalization is enabled on Android.",
"examples": [
true
]
}
},
"required": [
"$schema",
"event",
"platform",
"identity_type",
"contact_channel"
]
}