Dynamic event data variable in abandoned cart flow is not working.

  • 24 June 2022
  • 2 replies

Badge +2

Hello all,

I set up an abandoned cart and followed what I thought to be the correct syntax
{{ organization.url }}products/{{ item.product.handle }}
This was based off of this document.

However, after messing with that for a long time and it never working, I went ahead and setup a brand new Abandoned Cart.  It appears that the language has changed. It is now the following…
{{ organization.url|trim_slash }}/products/{{ item.product.handle }}

Is the documentation outdated?  Where can I find new documentation?  Are there other flows that are broken as well?




Best answer by stephen.trumble 24 June 2022, 18:16

View original

2 replies

Userlevel 7
Badge +60

Hey @gpstew 

Thanks for asking the Klaviyo Community for help with your abandoned cart flow. Happy to help!

To start, what are you using as the flow trigger? Metric triggered flows use different event variables in a flow depending on the metric you are using and your integration. Since this is an abandoned cart flow I will assume you are using Started Checkout as your flow trigger. You can find the correct event variable to use by clicking on the email in the flow that you want to include the dynamic event data, next click Configure Content> Edit Content> Preview. You’ll see a popup saying, Choose a recent event to preview with. In the window, you will see a recent event that corresponds with the flow trigger. For example, in an Abandoned Cart flow email, the preview window will show a recent Started Checkout event. To view a specific event variable, click on any line of data to reveal the associated template variable. The variable will appear within a gray box at the bottom of the window. List entries are numbered starting at 0 (not 1, as this information is brought over in an array), and this number does not equal the item quantity. For instance, if {{ }} is the variable entry for an image, the 0 indicates that it is the first item in the array (and not that there is no product images). 

You will need to copy the variable exactly as it is in the preview to make sure it populates correctly. You can also check out these other community post on the same topic: 

Hope this helps!

Badge +2

Thanks for the thorough reply, @stephen.trumble 

Yes, I am using Started Checkout as the flow trigger.  I think the main thing I was trying to get at is that I was using Klaviyo’s documentation and the provided code was not working.
In order to solve my situation, I setup a brand new abandoned cart flow and then copied the code from that flow.  
The article that I was provided shows how to build an abandoned cart dynamic block and said to use the following, however, it didn’t link properly. 404’d because of the lack of / before products
{{ organization.url }}products/{{ item.product.handle }}  
The new abandoned cart flow that I set up uses the following and works properly.
{{ organization.url|trim_slash }}/products/{{ item.product.handle }}

I was wondering where I might be able to find an updated article for this type of code.  I appreciate the helpful event variable info you provided above.