Solved

Sending a List-Based Custom Property to Klaviyo

  • 11 June 2021
  • 4 replies
  • 26 views

Badge

We have a custom property called Vehicles where we would want to store list of vehicles. I know Klaviyo only supports list of value but not object. So, though we can’t store like below:


 

[

{

“make”: “TOYOTA”,

“model”: “YARIS”,

“year”: 2008

},

{

“make”: “HYUNDAI”,

“model”: “I30”

“year”: 2010

}

]

And if we store like this:

[“TOYOTA-YARIS-2008”, ”HYUNDAI-I30-2010”]

 

can we segment our profiles based on make and/or model only? Could you please tell us how can we do that?

 

Thanks.

icon

Best answer by Dov 11 June 2021, 21:31

Hello @bikashlama,

Thanks for posting your question to the Klaviyo Community.

If you decide to store that data as a list data-type, you can only segment off of each value in the array but not a partial value. Using your example, you would be able to segment: properties about someone > TOYOTA-YARIS-2008 but not TOYOTA or YARIS in its own right.

So the solution here would be to send a value for each make/model/year together and have more values in the array i.e. [“TOYOTA-YARIS-2008”,”TOYOTA-YARIS-2015”] etc. Also keep in mind that values will override not append. So if you send only TOYOTA-YARIS-2008 and then later send TOYOTA-YARIS-2015. Only TOYOTA-YARIS-2015 will remain as a value on the profile. The next time you send a request it would have to include all previous values so [“TOYOTA-YARIS-2008”,”TOYOTA-YARIS-2015”].

I hope this helps! Thanks and have a great weekend.

View original

4 replies

Userlevel 5
Badge +4

Hello @bikashlama,

Thanks for posting your question to the Klaviyo Community.

If you decide to store that data as a list data-type, you can only segment off of each value in the array but not a partial value. Using your example, you would be able to segment: properties about someone > TOYOTA-YARIS-2008 but not TOYOTA or YARIS in its own right.

So the solution here would be to send a value for each make/model/year together and have more values in the array i.e. [“TOYOTA-YARIS-2008”,”TOYOTA-YARIS-2015”] etc. Also keep in mind that values will override not append. So if you send only TOYOTA-YARIS-2008 and then later send TOYOTA-YARIS-2015. Only TOYOTA-YARIS-2015 will remain as a value on the profile. The next time you send a request it would have to include all previous values so [“TOYOTA-YARIS-2008”,”TOYOTA-YARIS-2015”].

I hope this helps! Thanks and have a great weekend.

Badge

Yeah @dov.derin I am kind of aware about replacing the property value than appending so we are good on that. But thank you for reminding that again since it’s important to know. :relaxed:

 

However, I am a bit confused. Did you mean I should have separate properties for make model year rather than vehicle and have store values like this?

make: [“TOYOTA”, “TOYOTA”]

model: [“YARIS”, “YARIS”]

year: [2015, 2018]

 

Thanks.

Userlevel 5
Badge +4

Hello @bikashlama,

Thanks for your reply.

Ok - great just wanted to make sure that was clear =]

Yes, you just have to ensure that you’re always matching the first item in the “make” array (TOYOTA) with the first item in the “model” array (YARIS) with the first item in the “year” array (2015). This can make it tricky to manage the data if there are any changes made, but it will allow you to segment off of only the make/model/year.

Badge

Understood. Thanks @dov.derin.

Reply