Skip to content

Push

Handles push notification permission and interaction tracking for Segmentify push campaigns.

View as Markdown llms.txt

Handles push notification permission and interaction tracking for Segmentify push campaigns. These events must be sent when a user arrives on your site via a push campaign link where utm_medium=push.

Before sending these events, verify that the campaign URL contains the required UTM parameters: utm_source=segmentify, utm_medium=push, and utm_campaign=pushCampaignName.

Requests:

  • Accept Notifications — registers the user’s push subscription with Segmentify’s push service (psh2.segmentify.com). Sends the browser instanceId to associate the subscription with the user.
  • Deny Notifications — records the user’s decision to deny push notifications. Sent to gimli-eu.segmentify.com as a GET request with userId, instanceId, browser, and device as query parameters.
  • Native Push Permission — registers a native push permission event via psh2.segmentify.com/native/subscription/push. Used for native app or browser-level push opt-in flows.
  • Native View Interaction — fires when a user views content after arriving from a push notification (type: "view"). Sent to psh2.segmentify.com/native/interaction/notification.
  • Native Click Interaction — fires when a user clicks on a push notification (type: "click"). Sent to psh2.segmentify.com/native/interaction/notification.

POST /native/subscription/push

Example body

{
"deviceToken": "FCM_DEVICE_TOKEN",
"type": "PERMISSION_INFO",
"providerType": "FIREBASE",
"userId": "1234567890123456789",
"device": "PC",
"os": "ANDROID",
"email": "user@example.com"
}

See this endpoint in the Events API reference.

POST /native/interaction/notification

Example body

{
"os": "IOS",
"device": "PC",
"type": "VIEW",
"instanceId": "psh_xxxx",
"userId": "1234567890123456789",
"providerType": "FIREBASE"
}

See this endpoint in the Events API reference.

POST /native/interaction/notification

Example body

{
"os": "PC",
"device": "PC",
"type": "CLICK",
"instanceId": "psh_xxxx",
"userId": "1234567890123456789",
"providerType": "FIREBASE"
}

See this endpoint in the Events API reference.

POST /subscription/push

Example body

{
"subscriptionId": "PUSH_SUBSCRIPTION_ID",
"auth": "PUSH_AUTH_SECRET",
"key": "PUSH_P256DH_KEY",
"userId": "1234567890123456789",
"agent": "ANDROID",
"endpoint": "https://fcm.googleapis.com/fcm/send",
"deviceType": "ANDROID",
"isVapid": false,
"fcmToken": "FCM_DEVICE_TOKEN"
}

See this endpoint in the Events API reference.

GET /subscription/deny

See this endpoint in the Events API reference.