Push Open Tracking
When SmartAppPush delivers a push, it includes a tracking_token in the payload. Report this token back when the user opens the notification to power your analytics.
Endpoint
endpoint
http
POST https://api.smartapppush.ai/pushes/openedRequest
request body
json
{
"tenant_id": "your_tenant_id",
"api_key": "your_app_api_key",
"tracking_token": "uuid-from-push-extra-data"
}Response
200 OK
json
{
"success": true
}Error Responses
| Status | Meaning |
|---|---|
| 400 | Missing required fields (tenant_id, api_key, tracking_token) |
| 401 | Invalid tenant_id or api_key |
How to Implement
- When your app receives a push notification, extract
tracking_tokenfrom theextra_datapayload - When the user taps the notification and your app opens, send the tracking token to this endpoint
- SmartAppPush marks the push as opened and reflects it in your analytics dashboard
Example Implementation
push-handler.js
javascript
// In your push notification handler
onNotificationOpened(notification) {
const trackingToken = notification.extra_data?.tracking_token;
if (trackingToken) {
fetch("https://api.smartapppush.ai/pushes/opened", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
tenant_id: "your_tenant_id",
api_key: "your_api_key",
tracking_token: trackingToken
})
});
}
// Handle deep linking with extra_data
navigateToScreen(notification.extra_data?.screen);
}Why This Matters
Open tracking powers your campaign Health Scores, open rate metrics, and campaign comparisons. Without it, your analytics only show delivery data. With it, you see the full picture: which campaigns actually drive user engagement.