Solved

Can you send Custom Properties to Klaviyo over the API? If so can you send bulk?

  • 6 August 2021
  • 3 replies
  • 2149 views

Badge +2
  • Contributor I
  • 1 reply

We’d like to send CRM data over to Klaviyo to use to segment email campaigns etc.

Reading through the docs it appears this is possible via established integrations, but I can’t find a reference to sending custom properties over the API, is it properties as described in the Track/Identify Profile Activity here?

If it is possible to send custom properties over the Track or Identify Profile API which I believe may be the case, is it possible to send bulk actions, or is it only possible to send one member at a time?

Many thanks!

icon

Best answer by cbarley 6 August 2021, 17:35

View original

3 replies

Userlevel 3
Badge +5

Hi @JMD , you’re definitely on the right track! If you’re just looking to send Profile Properties to Klaviyo, you should use the identify endpoint. Any timestamped action (like when somebody places an order or starts a checkout) would be what the track endpoint is for.

Since Klaviyo has a schema-less database (noSQL), you don’t have to pre-define the custom properties inside Klaviyo before you send those API requests. So you could start right away by sending your CRM data to Klaviyo via the identify endpoint as soon as you’d like. An example payload might look like this:

{
"token": "ABC123",
"properties": {
"$email": "connor.test@klaviyo.com",
"$first_name": "Connor",
"$last_name": "B",
"Total Number of Purchases": 3,
"Loyalty Points": 200,
"Language Preference": "EN"
}
}

The identify endpoint was designed for very high throughput and low latency, and is an asynchronous endpoint. Because of this, we don’t have a way to bulk-upload this data, but you can essentially make API requests as fast as you’d like and you will almost certainly not hit any rate limits. 

Badge +2

Hi @cbarley,

That’s great, thanks very much for confirming and going through the effort of sending the examples, I had got a bit confused around the different property types but it seems there are properties, customer as defined by Klaviyo, then custom as defined by you.

I’ve read a little about the responses indicating whether the request is valid but not going so far as to tell you that it’s been processed. Is there a place to pull status or errors at all? Or will it be a case of comparing segments on our end against those that we have pulled back out of Klaviyo to compare?

Thanks!

Userlevel 3
Badge +5

Hey @JMD , yeah exactly - we have properties that Klaviyo auto-populates under certain circumstances like location based off of our cookie placed on your website (if somebody has done some activity on your site to become known), as well as a “How They Last Found You” section which will tell you how a person last landed on your website. And then we have everything else that you can decide to send to Klaviyo that will show up under the “Custom Properties” section. Those fields can be anything (string, number, array, object, boolean, etc.). Harkening back to the noSQL data schema, we will also interpret the data type for you.

As for the responses, we only return a 1 (if successful) or 0 (if the request fails) and we don’t have a place to pull statuses at this point. What we would recommend is that if you do receive a 0 back from any API call (this is almost always due to improper JSON formatting or encoding), that you save those requests and attempt to retry them. But generally, yes you’ll want to just check both locations to see if they match

Reply