Klaviyo icon

Klaviyo

Interact with the Klaviyo API

Actions17

Overview

This node integrates with the Klaviyo API to create custom event data. Specifically, the Event - Create operation allows users to send event metrics along with detailed attributes and profile information to Klaviyo. This is useful for tracking user interactions, conversions, or any custom events within marketing automation workflows.

Typical use cases include:

  • Logging user actions such as purchases, signups, or page views.
  • Sending custom metrics to analyze user behavior.
  • Associating events with user profiles by providing identifying attributes like email or phone number.

For example, you might create an event named "Purchase" with attributes like value (purchase amount) and unique_id (transaction ID), linked to a user profile identified by their email.

Properties

Name Meaning
Event Metric The name of the event metric to create. This identifies the type of event being tracked, e.g., "n8n Event", "Purchase", or "Signup".
Event Attributes Key-value pairs describing the event's details. Keys can be selected from predefined options (time, value, value_currency, unique_id) or custom string keys. Values are strings representing the attribute values.
Profile Attributes Key-value pairs that identify or describe the user profile associated with the event. Keys include common identifiers like email, phone_number, external_id, and other profile fields such as first_name, locale, etc. Values are strings.
Notice Informational message indicating that at least one of the following profile attributes is required: email, phone number, or external ID.

Output

The node outputs JSON data representing the response from the Klaviyo API after creating the event. The structure includes:

  • data: Contains the created event resource with its attributes and relationships.
  • attributes: Reflects the event metric name, event attributes, and profile data sent.
  • No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the Klaviyo API.
  • The node uses the base URL https://a.klaviyo.com/api and expects JSON API formatted requests and responses.
  • Proper configuration of the API key in n8n credentials is necessary.

Troubleshooting

  • Missing Required Profile Attributes: The node requires at least one of email, phone_number, or external_id in the profile attributes. Omitting these will likely cause the API to reject the request.
  • Invalid Event Metric Name: Ensure the event metric name is correctly specified; otherwise, the event may not be recorded properly.
  • API Authentication Errors: Verify that the API key credential is valid and has sufficient permissions.
  • Malformed Attributes: Attribute keys and values must be strings; incorrect types or missing keys may cause errors.
  • Network Issues: Connectivity problems to the Klaviyo API endpoint will prevent event creation.

Links and References

Discussion