Overview
Zixflow automatically tracks push notification delivery and engagement metrics to help you measure campaign performance. The SDK tracks three key lifecycle events:- Delivery Confirmed - When the notification arrives on the device
- Notification Opened - When the user taps the notification
- Action Button Clicked - When the user taps an action button
How Push Tracking Works
When Zixflow sends a push notification, it includes special tracking fields in the data payload:| Field | Purpose |
|---|---|
Zixflow-Delivery-ID | Unique ID for this delivery (links to campaign record) |
Zixflow-Delivery-Token | The FCM token the notification was sent to |
Note: The SDK automatically handles most tracking for you. This section covers advanced customization scenarios.
Tracking Events
1. Delivery Confirmed
When to track: The moment the push payload arrives on the device SDK method:trackMetric(deliveryID, deviceToken, event = MetricEvent.DELIVERED)
Basic implementation (in FirebaseMessagingService):
Important: The Zixflow SDK automatically tracks delivery when usingModuleMessagingPushFCM. Manual tracking is only needed if you have a customFirebaseMessagingServiceimplementation.
2. Notification Opened
When to track: When the user taps the notification banner (body or action button) SDK method:trackMetric(deliveryID, deviceToken, event = MetricEvent.OPENED)
Implementation (in launcher Activity):
Note: The SDK automatically tracks opens when using the default push implementation. This is only needed for custom implementations.
3. Action Button Clicked
When to track: When the user taps a named action button SDK method:track("Push Notification Action Clicked", properties)
Implementation (in NotificationActionReceiver):
| Property | Type | Required | Description |
|---|---|---|---|
Zixflow-Delivery-ID | string | ✅ | Links event to campaign delivery |
action_index | integer | ✅ | 0-based index of button tapped |
action_name | string | ✅ | Button label (e.g., “Shop Now”) |
Zixflow-Delivery-Token | string | Recommended | FCM token |
action_deeplink | string | Recommended | Button’s URL |
Action Buttons Format
Theaction_buttons field is a JSON-encoded string containing button definitions:
Raw payload value:
- Maximum 2 buttons per notification (recommended for consistency)
deeplinkmay be empty — handle gracefully- Button index is 0-based (first button = index 0)
Handling Existing FirebaseMessagingService
If your app already has a customFirebaseMessagingService, delegate Zixflow push handling:
AndroidManifest.xml:
Tracking Decision Flowchart
Fallback for Non-Zixflow Push
If a push notification doesn’t containZixflow-Delivery-ID (sent from another source), the SDK automatically skips tracking.
For custom analytics on non-Zixflow pushes, use a different event name:
Important: Push notification event names (Push Notification Delivered,Push Notification Opened,Push Notification Action Clicked) are reserved for Zixflow’s delivery pipeline.
Testing Push Tracking
Verify Tracking Events
Enable debug logging to see tracking events:[Zixflow] Push Notification Delivered tracked[Zixflow] Push Notification Opened tracked[Zixflow] Push Notification Action Clicked tracked
Check Campaign Analytics
- Log into Zixflow dashboard
- Navigate to Messaging → Push Notifications
- View campaign metrics:
- Sent - Total notifications sent
- Delivered - Arrived on device
- Opened - User tapped notification
- Clicked - User tapped action button