Capture Push Metrics
UpdatedHow it works
Customer.io supports device-side metrics that help you determine the efficacy of your push notifications: delivered
when a push notification is received by the app and opened
when a push notification is clicked.
As of version 1.0.0-beta.14
of our Expo plugin, we track both opened
and delivered
metrics automatically for you.
Beginning in version 1.0.0-beta.14
of our Expo plugin, the SDK automatically tracks opened
and delivered
events for push notifications originating from Customer.io. No more code is required for your app to track opened
push metrics or launch deep links!
Do you use multiple push services in your app?
The Customer.io SDK only handles push notifications that originate from Customer.io. Push notifications that were sent from other push services or displayed locally on device are not handled by the Customer.io SDK. You must add custom handling logic to your app to handle those push events.
Read the sections below to see how you can add (optional) custom handling to various push events.
Choose whether to show push while your app is in the foreground
If your app is in the foreground and the device receives a Customer.io push notification, your app gets to choose whether or not to display the push.
To configure this behavior, set the following option in your Expo config file:
{
...
"plugins": [
...
[
"customerio-expo-plugin",
{
"ios": {
"showPushAppInForeground": true,
}
}
]
]
}
If the push did not come from Customer.io, you’ll need to perform custom handling to determine whether to display the push or not.
Custom handling when users click a push
You might need to perform custom handling when a user clicks a push notification—like when you want to process custom fields in your push notification payload.
Follow our React Native SDK guide to setup handling in your app.
Custom handling when getting a push while the app is foregrounded
If your app is in the foreground and you get a push notification, your app gets to choose whether or not to display the push. For push notifications originating from Customer.io, your SDK configuration determines if you show the notification. But you can add custom logic to your app when this kind of thing happens.
Follow our React Native SDK guide to setup handling in your app.
Manually track push metrics
Avoid duplicate push metrics
If you manually track your own metrics, you should disable automatic push tracking to avoid duplicate push metrics.
Follow our React Native SDK guide to setup manual push metrics in your app.
Disabling automatic push tracking
If you have a more advanced use case and want to manually track push metrics, you can disable automatic push tracking with the autoTrackPushEvents
option in your Expo config.
{
...
"plugins": [
...
[
"customerio-expo-plugin",
{
"ios": {
"autoTrackPushEvents": false,
}
}
]
]
}