Overview
With the Dart FCM +flutter_local_notifications integration (see Push Notifications and push_handlers.dart), you track engagement yourself:
- Delivered — call
trackMetric(delivered)when the FCM data payload arrives (foreground and background), before showing the local notification; optionally also use an iOS NSE - Opened — call
trackMetric(..., MetricEvent.opened)on body taps and action presses - Action Button Clicked — call
track(name: 'Push Notification Action Clicked', ...)
navigation.dart + url_launcher.
How Push Tracking Works
Example push payload:
Tracking Events
1. Delivery Confirmed
When: The push payload arrives on the device. SDK method:Zixflow.instance.trackMetric(..., event: MetricEvent.delivered)
Optional manual delivery tracking (e.g. foreground Android):
2. Notification Opened
When: User taps the notification body (or an action button — track opened first, then the action event). SDK method:Zixflow.instance.trackMetric(..., event: MetricEvent.opened)
_trackOpened from the local-notification tap handler (body and actions), using the JSON payload you stored when showing the notification.
3. Action Button Clicked
When: User tapsACTION_0 or ACTION_1.
SDK method: Zixflow.instance.track(name: 'Push Notification Action Clicked', properties: {...})
deeplink if set, else deeplink_url.
Required / recommended properties:
Deeplink opening (example pattern)
Shared helper used for FCM system opens and local-notification taps (navigation.dart):
navigatorKey to MaterialApp and register named routes for in-app hosts. On Android 11+, declare <queries> for http/https if you open external links with url_launcher (see Push Notifications).
Full tap hub (body vs action) from the example:
Action Buttons Format
- Maximum 2 buttons (
ACTION_0,ACTION_1) - Empty
deeplinkis allowed — fall back todeeplink_urlor skip navigation
Background Isolate Taps
When the app was terminated and the user taps a local notification, the response may run in a background isolate. Re-initialize Zixflow before tracking:onDidReceiveBackgroundNotificationResponse when initializing FlutterLocalNotificationsPlugin.
Tracking Decision Flow
Fallback for Non-Zixflow Push
If the payload has noZixflow-Delivery-ID, skip Zixflow push metrics. For your own analytics, use a different event name (do not use reserved push event names):
Push Notification Action Clicked and the metric pipeline behind trackMetric.