Screen View
A screen_view event example focused on Android and iOS Firebase implementations.
DataLayer Example
- Android Firebase (Kotlin)
- Android Firebase (Java)
- iOS Firebase (Swift)
- iOS Firebase (Obj-C)
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW) {
param(FirebaseAnalytics.Param.SCREEN_NAME, "Checkout")
param(FirebaseAnalytics.Param.SCREEN_CLASS, "CheckoutScreen")
}
Bundle eventParams = new Bundle();
eventParams.putString(FirebaseAnalytics.Param.SCREEN_NAME, "Checkout");
eventParams.putString(FirebaseAnalytics.Param.SCREEN_CLASS, "CheckoutScreen");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW, eventParams);
var eventParams: [String: Any] = [
AnalyticsParameterScreenName: "Checkout",
AnalyticsParameterScreenClass: "CheckoutScreen"
]
Analytics.logEvent(AnalyticsEventScreenView, parameters: eventParams)
NSMutableDictionary *eventParams = [@{
kFIRParameterScreenName: @"Checkout",
kFIRParameterScreenClass: @"CheckoutScreen"
} mutableCopy];
[FIRAnalytics logEventWithName:kFIREventScreenView 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/screen-view-event.json" | ||||
| event | string | required | | The event name for a screen view. |
const: "screen_view" | ||||
| screen_name | string | required | | Human-readable screen name. |
| screen_class | string | required | | Screen class or view controller name. |
additionalPropertiesSchema constraintControls properties not listed in properties and not matched by patternProperties. | string, number, integer, boolean, null |
View Raw JSON Schema
{
: "https://json-schema.org/draft/2020-12/schema",
: "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/screen-view-event.json",
"title": "Screen View",
"description": "A screen_view event example focused on Android and iOS Firebase implementations.",
"x-tracking-targets": [
"android-firebase-kotlin-sdk",
"android-firebase-java-sdk",
"ios-firebase-swift-sdk",
"ios-firebase-objc-sdk"
],
"type": "object",
"properties": {
"$schema": {
"type": "string",
"description": "Defines the structure of the event.",
"const": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/screen-view-event.json"
},
"event": {
"type": "string",
"const": "screen_view",
"description": "The event name for a screen view."
},
"screen_name": {
"type": "string",
"description": "Human-readable screen name.",
"examples": [
"Checkout"
]
},
"screen_class": {
"type": "string",
"description": "Screen class or view controller name.",
"examples": [
"CheckoutScreen"
]
}
},
"required": [
"$schema",
"event",
"screen_name",
"screen_class"
],
"allOf": [
{
"$ref": "https://tracking-docs-demo.buchert.digital/constraints/schemas/firebase/v1/flat-event-params.json"
}
]
}