PushFyreAccelerate. Ignite. Broadcast.

Custom events

Record what people do from the SDK or your server, then use it in segments and journeys.

A custom event is a named action, such as purchase_complete. Audience → Events lists each name, how often it happened in the last 7, 30 or 90 days, and the latest occurrences.

From the SDK

Call trigger when the action happens. The call shows a matching in-app message and stores the event.

PushFyre.trigger(context, "purchase_complete", mapOf("sku" to "sku_42", "total" to 19.0))

The properties argument is optional. Omit it when the name is enough.

Names and properties

  • A name is 1 to 80 characters: letters, digits, spaces, or _ . : -. It must start with a letter or digit. It is stored in lowercase, so Purchase_Complete and purchase_complete are the same event.
  • Properties are optional. At most 10 keys. A key is 1 to 40 letters, digits, or _ . -.
  • A value is text of at most 200 characters, a finite number, or true or false.

From your server

POST /api/v1/events with the same app API key headers as a send. One call accepts 1 to 100 events. Each event needs a deviceId or an externalUserId. occurredAt is optional and can be up to 7 days ago.

bash
curl -X POST https://push.example.com/api/v1/events \
  -H "Content-Type: application/json" \
  -H "x-app-id: app_49e692ad" \
  -H "x-api-key: <api-key>" \
  -H "x-tenant-id: <tenant-id>" \
  -d '{
    "events": [
      { "name": "purchase_complete", "externalUserId": "user-1001", "properties": { "sku": "sku_42" } }
    ]
  }'

Show an in-app message

Open the in-app campaign and go to Display Settings. Choose When certain conditions are satisfied during the session, then add an In-App Trigger with Key set to the event name and Value set to true. PushFyre.trigger sets that key to true and can show the message. The key must match the name you pass, including capitals.

A server POST /events stores the event and can start a journey. It does not open the in-app message. The app has to call PushFyre.trigger.

Event properties are stored with the event. The in-app trigger compares the key and the value true. To match a property such as a plan or an order total, use a segment.

Use an event

  • An in-app campaign can show when the app calls PushFyre.trigger with that name. See In-app messages.
  • A segment filter Custom Event matches people who did a named event, using the event name and optional property rules.
  • A journey can start when the event is recorded, from the app or from POST /events. See Journeys.

Each occurrence is kept for 90 days. If the plan has custom events turned off, trigger can still show the in-app message and the event is not stored.

Editors and viewers can open Audience → Events. Recording from the app does not need a portal role.