Web feed with different personalized products per profile
Hello.
I’m looking to send personalized products recommendations to subscribers using dynamic blocs.
The product recommendations will be a JSON feed from another system.
I was wondering if I could use a web feed with products per profile. Is there a specific structure that I should follow ?
Or maybe there’s another way to import individual recommendations into a customer profile ?
Thanks !
Page 1 / 1
Hello @jocallier,
Thanks for reaching out to the community. We are glad to have you here!
Web feeds are great for displaying data dynamically, however they will not be able to target based on personalized recommendations. In order to target individual’s based on personalized recommendations, I recommend either using product feeds or sending Klaviyo the JSON as a custom event, using the Track API (more details on the Track API here). You would then trigger a flow off of this custom event. The content of the flow email could then be personalized based on the event variables in the track event. It is completely up to you what data you’d like to include in the event. I recommend reviewing our guide on using event variables to personalize flows for more detail on how to populate personalized dynamic data for each recipient in your flow email(s).
Alternatively, you can use the Identify API which will populate information on the user profiles as custom properties. You would then use personalization variables to dynamically pull in these custom properties in your emails. The advantage of using the Identify API is that this dynamic data can be used in both flows and campaigns. Dynamic data from track events can only be pulled into flows.
I am also attaching a thread below with a use-case on using the Track API:
I hope that is helpful.
Thaky you @Dov for your answer.
It does help a lot.
I have done a quick proof of concept using custom properties as I plan to use this data for both campaigns and flows.
I used one custom property in which I pushed directly the HTML and used personalization variables with ‘autoescape off’ directive to display this code in the email and i works perfectly.
However, I’m wondering if pushing HTML code directly in a custom property is the best way to display this personalized content ? I might have 3 to 5 different products for each customers. Should I create properties like ‘product_perso_url_1’, ‘product_perso_image_url_1’, ‘product_perso_title_1’, ‘product_perso_url_2’, ‘product_perso_image_url_2’, etc ?
Or is there a way to create some sort of array or JSON structure within a single property and then loop in this structure in the template ?
What would be your advice here ?
Thanks again !
Thanks @jocallier!
So glad to hear that using custom properties has been helpful for you.
The easiest solution is to use discrete custom properties +values for each of these fields and then use standard personalization variables to dynamically pull in these custom properties in your emails. For example, {{ person|lookup:'Favorite Color' }}.
Alternatively, if you organize these in an array of values within the property i.e. Favorite Color “Blue”, “Red”, “Orange”] you can target individual values within the array using {{ person|lookup:'Favorite Color'|lookup:'color name' }}In that example, the 'color name' would be replaced with what the array item is labeled i.e. “Red”. If you wanted to pull the first value in the array you could use {{ person|lookup:'Favorite Color'|lookup:'0' }}. 0 being the first value in the array, in this case the color Blue. The second value in the array would be 1, the third value in the array would be 2 etc.
Hope that helps!
Thanks @Dov !
In the meantime, I think I figured out a solution that works pretty well for me.
Let me know if you think there’s something wrong or something that can be optimized.
First I use an array of arrays in a custom property, so for example
So the important thing to do is to keep the name, url and image link of the product always in the same order in the array, so that I can access them using value.0, value.1, value.2
It worked pretty well so far.
Thanks!
Hi @jocallier,
Thanks for sharing this. Looks really good! Yes, I think this will work fine as long as you keep the order of items the same.
Thanks for being a member of our community.
Hi @Dov
It seems I’ve spoken a little too fast.
The solution I described works perfectly as long as you update the data in the custom property manually from the interface.
So, for example, I go in my profile page in Klaviyo and add or update a custom property in an list format such as ‘s“element1”,”element2”] or event “element_1_1”,”element_1_2”],“element_2_1”,”element_2_2”]]
The system will automatically detect it’s a list and will treat the property as such. Therefore, in this case, the code provided in my previous post works.
However, when the property is updated through the API, the system treats it as a normal string of text and does not recognize the fact list format.
Is there a way to force the system to consider the custom property as a list ?
Thanks
Hello @jocallier,
Thanks for the updated note!
Check out the solution outlined in this thread!
In short, in order to update or add an array/list property to a profile you need to pass the query parameter and value for each item in the list e.g.
?newKey=cat&newKey=dog
This will then be reflected on the profile as
Or you can add it like the following format described here: