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), Query Campaign Values (1 year)
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
Campaigns Email (included messages)-IDGet Campaigns
Campaigns Email (included tags)-IDGet Campaigns
TemplatesUPDATEDIDGet Templates
ProfilesCREATEDIDGet Profiles
EventsDATETIMEIDGet Events
Events (Custom dates)-IDGet Events
Metrics-IDGet Metrics
ListsUPDATEDIDGet Lists
SegmentsUPDATEDIDGet Segments
Flows-IDGet Flows
Flow Actions-IDGet Flow Actions
Flow Action Messages-IDGet Flow Action Messages
Query Metric Aggregates (custom query)-IDQuery Metric Aggregates
Query Campaign Values-IDQuery Campaign Values

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 Metric 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.

πŸ“˜

Query Campaign Values

To run this report, you will need aconversion_metric_id. The Metrics report provides theID for possible metrics that can be used to calculate the conversion-based statistics.

For example, to run the report for the Placed Orders metric, retrieve the correspondingID from theMetric Report. This IDcan then be used as an input for theQuery Campaign Values report.


Limitations


🚧

Flow Action Messages report

Please run this report/extract on its own (not while other extracts are running in the same Source), as the rate limits are quite restrictive.