Actions3
- Template Actions
- Event Actions
Overview
This n8n node allows you to create a new event in Klaviyo via its API. The "Create Event" operation under the "Event" resource is designed for tracking custom events (such as product views, purchases, or other user actions) and associating them with user profiles. This is useful for marketing automation, segmentation, and analytics within Klaviyo.
Common scenarios:
- Tracking when a user performs a specific action (e.g., viewed a product, completed a purchase).
- Sending custom event data from your application or workflow into Klaviyo for further automation.
- Associating events with detailed profile information and custom attributes for advanced segmentation.
Practical example:
When a customer completes a purchase on your website, you can use this node to send a "Purchased Product" event to Klaviyo, including details like the purchase amount, time, and customer profile information.
Properties
Name | Type | Meaning |
---|---|---|
Metric Name | String | Name of the event (e.g., "Viewed Product"). Must be less than 128 characters. Identifies the type of event being tracked. Required. |
Properties | Fixed Collection | Optional advanced properties for the event. Includes: - Metric Service: For advanced usage; usually left blank. - Time: When the event occurred (defaults to request time). - Value: Numeric value associated with the event (e.g., purchase amount). - Unique ID: Unique identifier for the event to prevent duplicates. |
Profile | Fixed Collection | One or more key-value pairs identifying the user profile associated with the event. Required. Common keys include $email , $phone_number , etc. Used to link the event to a specific user and for segmentation. |
Attributes | Fixed Collection | Optional list of additional event attributes as key-value pairs. These can be used for segmentation or storing extra data related to the event. Special property $extra can be used for non-segmentable values. There are limits on size and nesting. |
Output
The node returns the response from the Klaviyo API as JSON. The structure typically includes:
{
"data": {
"type": "event",
"id": "...",
"attributes": {
// Event details as sent/created
}
},
// ...other metadata fields depending on Klaviyo's API response
}
- The
json
output field will contain the full API response, including the created event's details. - No binary data is produced by this operation.
Dependencies
- External Service: Requires access to the Klaviyo API.
- API Key: You must provide a valid Klaviyo API Key via n8n credentials (
klaviyoApi
). - n8n Configuration: No special configuration beyond setting up the credential.
Troubleshooting
Common issues:
- Invalid or missing API Key: If the API key is incorrect or missing, you'll receive an authentication error. Ensure your n8n credential is set up correctly.
- Missing required fields: If required properties like "Metric Name" or "Profile" are not provided, the node or API will throw an error.
- Invalid data formats: Supplying incorrectly formatted dates, exceeding attribute limits, or using invalid profile keys may result in API errors.
- Duplicate unique IDs: If you reuse a
uniqueId
for the same profile and metric, only the first event will be recorded.
Error messages:
"401 Unauthorized"
: Check your API key."400 Bad Request"
: Review required fields and data formats."422 Unprocessable Entity"
: Likely due to invalid or duplicate data (e.g., uniqueId).