Import Klaviyo Data to Google Sheets

Klaviyo is an email and SMS marketing solution that allows you to collect and analyze customer data. Additionally, it integrates with other tools like BigCommerce, Shopify, WooCommerce, and others.

To get started, head over to Klaviyo and sign up for an account. Once you’re plugged in, let’s dive into the API docs to figure out what data we can grab!

PART 1: GET YOUR KLAVIYO API KEY

From the dashboard, go to your account.

In the top right corner, go to Settings -> API Keys.

Go ahead and create a new API key.

Klaviyo’s API docs actually conveniently save and display your API key in the docs, so you don’t necessarily need to save this anywhere. You can also delete and create new keys at your bidding.

PART 2: CREATE YOUR API REQUEST API URL TO GET LISTS

Let’s start by viewing all of our memberships and subscriptions. First, let’s grab all of our lists to figure out which one we want to view.

  • Base URL: https://a.klaviyo.com
  • Endpoint: /api/v2/lists

PART 3: PULL KLAVIYO LIST DATA INTO SHEETS

Go over to Google Sheets, open API Connector, and then under Headers, be sure to use the Key-Value pair api-key and your_private_API_key. You should see your API key inside the documentation here along the right side of the screen like in the image below:

I deleted this API key, so don’t even think about trying to use it 😉

Fill in the API URL path from the last step. In API Connector, you should have something that looks like this now:

Run the request, and you will get back a table showing all of your lists and their respective IDs.

You can now put that ID in a different API request to get all of the contacts in that list. Let’s go do that now!

PART 4: CREATE YOUR API REQUEST API URL TO GET SUBSCRIBERS

Now that we have a list of our lists, let’s make a new sheet to send our data to and call it something like “List Contents”.

Now let’s go ahead and grab the list_id of one of them. In this example, I’ll grab my “Test List” ID.

Now we need to setup our new API URL request. Following similar steps from before, we combine the base URL with our Endpoint:

  • Base URL: https://a.klaviyo.com
  • Endpoint: /api/v2/group/{YOUR_LIST_ID}/members/all

Don’t forget to change YOUR_LIST_ID with your unique list ID!

PART 5: PULL SUBSCRIBER DATA INTO SHEETS

Now take our URL path and api-key and fill in a new Request similar to part 3. You should end up with something that looks like this:

And now you have a spreadsheet of all contacts from that particular list!

PART 6: MORE EXAMPLE API URLS

Go head over to the documentation for a more detailed list of possible endpoints. Otherwise, try messing around with the ones I’ve dug up below:

  • https://a.klaviyo.com/api/v1/metrics?api_key={YOUR_API_KEY}
  • https://a.klaviyo.com/api/v1/person/{{ PERSON_ID }}
  • https://a.klaviyo.com/api/v1/campaigns
  • https://a.klaviyo.com/api/v1/email-templates

Note: the metrics endpoint REQUIRES you to put your api_key in the URL as a query parameter. It will not work if you keep it in the Header Key-Value pair as with the others.

Leave a Comment