Skip to main content
This guide takes one event, a customer booking an appointment, from your product to a message sent by a business. For the model behind this, see How events and triggers work.

Prerequisites

1. Define the event

Define the event once for your project. Give it a name and a phrase that completes the sentence “When…”, which is what businesses see when they choose what a trigger listens for. In the dashboard, open Resources > Triggering Events and create a new event. Or use the API:
The response includes the event’s id, which starts with pde_.

2. Track the event

When the event happens in your product, send it for the business it happened in. Set event to the event’s id or its name, and identify the customer inside data.
The response is the stored event, including its id. The request succeeds as soon as the event is stored. Matching it to a customer and to triggers happens afterwards. You can identify the customer by your own identifier, as above, or by the Pocketflows ID. See Tracking event payload examples. Include any other details in data that a business might want to filter on or mention in a message.

3. Set up a trigger for the business

A business sets up its own trigger in the embed:
  1. Create an embed for the business and open Triggers.
  2. Create a trigger and choose your event, shown as “When a customer books an appointment”.
  3. Add the messages to send and activate the trigger.
A trigger only runs while it is active. To save each business from building the same trigger, give them a ready-made one. See Give businesses pre-built campaigns, triggers and emails.

4. Check that it worked

Track the event again for a customer of that business, then look up what it did:
customer is the ID of the customer the event was matched to. It is null until the event has been processed, and stays null if no customer matched.
This lists the trigger executions the event started, one per trigger that matched.

Troubleshooting

If the event started nothing, check these in order:
  • customer is null on the event. The identifier in data does not match a customer of this business. Customers belong to one business, so check that you tracked the event for the business the customer was synced into.
  • The event name does not match. The event you sent must be the id or the exact event name of a project-defined event in the same project. Test mode and live mode are separate projects, each with its own events.
  • No trigger is active. The business has no active trigger listening for this event, or the trigger’s filter excludes this customer or event.