Klaviyo Events

Sends events to Klaviyo, such as placed orders, where Klaviyo flows and segments can react to them. Klaviyo creates the profile and the metric if they don’t exist yet.

Configuration

- klaviyo_events:
    name: track_order
    operation: create
    credentials_path: /etc/klaviyo/credentials.json
    payload:
      from_event: true

Fields

FieldTypeDefaultDescription
namestringrequiredTask name.
operationstringrequiredcreate.
credentials_pathstringrequiredPath to the credentials file.
base_urlstringKlaviyo’sKlaviyo API address, for example a proxy.
payloadobjectrequiredThe event’s attributes, or from_event: true. See Payload.
depends_onlistUpstream task names.
retryobjectRetry configuration.

Attributes

AttributeDescription
metricThe event’s name: {"data": {"type": "metric", "attributes": {"name": "Placed Order"}}}.
profileWho did it: {"data": {"type": "profile", "attributes": {"email": "..."}}}.
propertiesAnything else about the event, such as the order’s items.
valueA number, such as the order total.
value_currencyThe currency of value, e.g. EUR.
unique_idMakes Klaviyo count an event sent twice only once, e.g. the order ID.
timeWhen it happened, if not now.

value must be a number, while config templates render to text, so build the attributes in a script and use from_event: true.

Output

Klaviyo accepts the event without returning it, so the task emits {"accepted": true}.