Klaviyo

Version 0.0.8

πŸ“˜

Check out the API docs here for more information.

Our connector is using revision 2023-10-15 of the API.

Set up


To get set up with the Klaviyo connector you will have to generate a Klaviyo API key here.

Features


FeatureSupportNotes
Backfillβœ…Events (1 Month), Templates (2 years), Profiles (2 years), Lists (2 years), Segments (2 years), Campaigns (All time), Metrics (All time), Flows (All time)
Incrementalβœ…Events, Templates, Profiles, Lists, Segments
API reliability🟒Reliable API

Reports detail


⬇️ ReportπŸ”‘ Incremental keyπŸ”‘ Primary keyπŸ“„ Link to API endpoint
Campaigns (old v1 API)-IDGet Campaigns
Campaigns SMS-IDGet Campaigns
Campaigns Email-IDGet Campaigns
TemplatesUPDATEDIDGet Templates
ProfilesCREATEDIDGet Profiles
EventsDATETIMEIDGet Events
Events (Custom dates)-IDGet Events
Metrics-IDGet Metrics
ListsUPDATEDIDGet Lists
SegmentsUPDATEDIDGet Segments
Flows-IDGet Flows
Query Metric Aggregates (custom query)-IDQuery Metric Aggregates

Limitations


  • Due to rate limits with the Klaviyo API, it is not recommended to run more than two extracts at a time.
  • It is only possible to get one month worth of events data and the backfill can take several hours (applies for both Events and Events (Custom dates) reports
  • For Events (Custom dates) report the start and end values on the extract setup must be in the format 2024-01-02T23:20:49Z. Start datetime is exclusive and End datetime is inclusive

🚧

Campaigns

v1 / v2 legacy APIs are scheduled to retire on June 30, 2024. The report "Campaigns (old v1 API)" is relying on the old v1 API version so we suggest you use the new Campaign reports before Jun 2024 to avoid any issues.

πŸ“˜

Query Metri Aggregates (custom query)

For running this report you need to provide the custom query you want to execute (in JSON format). Information and tips on how to form this query can be found here

As explained in the API docs: because this endpoint allows for large scale event aggregation and grouping, it’s helpful to think of it as a way to execute SQL-style queries for data in Klaviyo.

For example, if you wanted to sum the revenue (using the Placed Order metric, for the metric-based report) by flow in your Klaviyo account for the last year using SQL, you would write something like this:

SELECT SUM(revenue)  
FROM klaviyo_event_data  
WHERE  
    metric="placed order"  
    AND timestamp>="2022-01-01"  
    AND timestamp\<="2023-01-01"  
    AND $flow!=null  
GROUP BY $flow

This can be achieved with the example query (while of course using the relevant metric_idfor your case):

{
    "data": {
         "type": "metric-aggregate",
         "attributes": {
              "measurements": [
                   "sum_value"
              ],
              "by": [
                  "$attributed_flow"
              ],
              "filter": [
                   "greater-or-equal(datetime,2022-01-01T00:00:00)",
                   "less-than(datetime,2023-01-01T00:00:00)",
                   "not(equals($attributed_flow,\"\"))"
                   
              ],
              "metric_id": "abc123",
              "interval": "month",
              "timezone": "US/Eastern"
         }
    }
}

The Metrics report can be used to find the relevant metric_id. Alternatively, you can find the corresponding metric_id in your Klaviyo account by navigating to the page for a given metric (more info here). Once on the page for a given metric, you'll find the metric_id in the URL (e.g.,https://www.klaviyo.com/metric/METRIC_ID/metricname).

Further examples and clarifications can be found on the link to the API docs above.

Data received from this report will need to be cleaned in a Transform.