Solved

"WishlistItemIDs" - What's the point?

  • 29 July 2021
  • 1 reply
  • 35 views

Badge
  • New Participant
  • 3 replies

Sorry for click-baity title, but hear me out.

 

We can add wishlist items as an event via:

   _learnq.push(["track", "Added to Wishlist", {
"$value": 29.98,
"ProductName": "A Tale of Two Cities",
"ProductID": "1112",
"SKU": "TALEOFTWO",
"Categories": ["Fiction", "Classics"],
"ImageURL": "http://www.example.com/path/to/product/image2.png",
"URL": "http://www.example.com/path/to/product2",
"Price": 19.99,
"Quantity": 1
}]);

Unfortunately, I am being told by the engineers that only the single product in the event is usable.

 

But according to the documentation found here, https://help.klaviyo.com/hc/en-us/articles/360038562411-Setting-Up-API-based-Website-Activity-Events#wishlist-items6

If you want an up-to-date record of the items in a given person’s wishlist, you can send this to Klaviyo using our server-side Identify API and our Catalog Feed feature.

{
"token": "PUBLIC_API_KEY",
"properties": {
"$email": "john.smith@test.com",
"WishlistItemIDs": ["1111","1112","1113"],
"WishlistItemNames": ["Winnie the Pooh","A Tale of Two Cities","Alice in Wonderland"]
}
}

You can use these IDs to set up a catalog lookup tag within an email template to display the items on the person’s wishlist in any campaign or flow email. You can use the names or IDs to segment based on which items are in a person’s wishlist.

 

Here is the problem, using a catalog lookup you end up with a string like so:

"["1111","1112","1113"]"

Not an actual array like,

array(
[0] => 1111,
[1] => 1112,
[2] => 1113
)

So from what I hear from the engineers, there is actually no way of using the IDs stored in WishlistItemIDs.

 

Then what is the point of maintaining an up-to-date record of items in a given person’s wishlist?

 

What is the missing piece here?

icon

Best answer by odp 30 July 2021, 12:55

View original

1 reply

Badge

Well look at silly me.

It was right there, very well hidden. Identify API

After changing my API call from an event to Identify, products are rolling in as custom properties. ready to be looped through in your template and flow.

 

{% for item in person|lookup:'WishlistItemIDs' %}
{% catalog item unpublished="cancel" %}
{{ catalog_item.title }}
{% endcatalog %}
{% endfor %}

 

Reply