Track event
plunk_track_eventRecord a contact event to drive workflow triggers and segment filters. Auto-creates the contact if missing; omit subscribed to keep opt-out state.
Instructions
Purpose: Record that a contact did something. Events drive workflow triggers and segment filters, and the contact is created if it does not exist.
Not for: Reading events back — that is plunk_list_events or plunk_get_contact_events. This writes one.
Returns: Confirmation that the event was recorded.
Use when: Something happened that automation should react to, or that you want to segment on later.
Note: Omitting subscribed preserves the contact's current subscription state; passing true would resubscribe someone who opted out. Works with or without PLUNK_PUBLIC_KEY: with it, one request; without it, the contact is upserted first and the event recorded against it. Pass idempotencyKey to make a retry safe after a timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Event/contact data. Use {value, persistent: false} to scope to workflows only. | |
| Yes | Contact email. Contact is auto-created if missing. | ||
| event | Yes | Event name, e.g. 'user-signup' | |
| subscribed | No | Subscription state to apply. Omit to preserve the contact's current state (new contacts default to subscribed). Pass false to track an event without resubscribing an unsubscribed contact. | |
| idempotencyKey | No | Optional. A unique string of your choosing that makes a retry safe: if this key was already used by the project, Plunk refuses the request with 409 instead of sending twice. Keys are remembered for 24 hours. Plunk v0.13+. |