Skip to main content

Hi everyone,

I’m running into an issue with the Added to Cart metric for a client on Shopify who offers shipping insurance.

I was able to hide the shipping insurance from the checkout flow, but since the Added to Cart flow triggers per event, it’s been tricky to manage. I added a filter so the flow doesn’t trigger when the only item in the cart is shipping insurance. However, most of the emails going out still show only the shipping insurance, since it’s often the first product that triggered the event.

I searched the community but didn’t find anyone reporting a similar issue. Has anyone else dealt with this on Shopify? I’d love to hear any workarounds or best practices to make sure that emails aren’t showing just the shipping insurance.

Thanks in advance!

Hi Nermine,

If I understand correctly, shipping insurance appears as a line item in the Added to Cart event. While you are able to filter it out for the flow email templates, it seems that the issue persists when shipping insurance is the only item in the cart. Could you please share the payload for the Added to Cart event when shipping insurance is the sole item?

If the information is nested, we are unable to act upon it for the trigger condition within the flow. The only possible solution is to prevent it on the client side by modifying the JavaScript.


Hi Jad,
Thanks so much for your reply. Here’s a screenshot of the payload, I might be wrong, but from what I can see it doesn’t look nested.

Just to clarify what I shared earlier: I was able to filter out shipping insurance so the flow doesn’t trigger if it’s the only item in the cart. The issue is that when shipping insurance is added alongside other products, it still becomes the first event that triggers the Added to Cart flow. As a result, the email customers receive only displays the shipping insurance, not the other products, since the metric is tracked per event.

 


@Nermine so what you are sharing is whenever Shipping Insurance is the only item and I understand you are able to filter it out from the flow.  What does it look like if Shipping Insurance exists alongside products you do wish to display in the email?  Does the payload consist of array property type like products you can use a django loop expression with an if statement you could ignore?
 

{% for product in products %}
    {% if not product.name|startswith:"Shipping Insurance" %}
        {{ product.name }} - {{ product.price }}
    {% endif %}
{% endfor %}

 


@whereisjad, Let’s take the Abandoned Checkout for example: all products are included in the items array, so I can loop through and skip Shipping Insurance. But in the Added to Cart event, each item fires as its own event, for example, without the filter the flow would send a separate email for every product added. The issue is that when Shipping Insurance is the first event, people end up receiving an abandoned cart email for the insurance only, instead of the other products they actually left in the cart.


@Nermine It seems there may be a misunderstanding. For example, if a customer purchases Shipping Insurance along with two other products, Klaviyo would generate an "Added to Cart" event for each item, totaling three events. If your flow is filtering out the "Added to Cart" event for Shipping Insurance, then it should still trigger based on the events for the other two products. Could you please share the details of the "Added to Cart" events for those other products? That would help me better understand what you mean when you mention that Shipping Insurance is the first event.


Reply