Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards

Is there a dimension or metric that allows us to check whether the cart contains products or is empty when a user visits the site?

Avatar

Level 2

Is there a dimension or metric that allows us to check whether the cart contains products or is empty when a user visits the site?
We're experiencing an issue where the cart is automatically emptied due to cookies, and we want to understand what percentage of users are affected by this.

Although there is a metric called 'Cart Removals (event)', the data shows zero, so we’re looking for an alternative way to check this.

5 Replies

Avatar

Community Advisor and Adobe Champion

This sounds like a better job for custom coding... 

 

Since you are trying to track down an issue where the cart is being cleared (either between sessions, or sometime during a session) without the user specifically "removing items from their cart", I would work with your developers to build something out.

 

I assume that the developers know the status of the cart at all times (I'm thinking there is a cart icon in the header showing a rough count of items, or maybe a sidebar showing a cart summary or something like that....)

 

So, I would work with your developers to ensure that you have your data layer populated with some basic cart info... i.e. how many items in the cart (maybe some more things that you feel will help you track this down).

 

Then you could create a dimension, such as "number of items in cart"... tracking this on every page... then you could look at how the user progress... such as, when the cart is empty was it proceeded by the user manually emptying the cart, or did the user make a purchase, etc.

 

 

You mentioned 'Cart Removals (event)' showing nothing. This isn't automatically collected, like Add to Cart, or Order, you would have to code this in.. but this would be tied to a specific action taken by the users to empty their cart, or at the very least, remove some items from the cart....  I wouldn't want to get that event confused with the error tracking initiative you are starting.

 

And honestly, going forward, tracking a basic "number of items in cart" could lead to interesting user behaviour analysis, beyond the issue you are trying to capture.

Avatar

Level 2

Thank you so much for your help each time. It looks like creating a custom Dimensions/metric is the most accurate approach
I wanted to check whether users had items in their cart or if it was empty, but it seems difficult to do that with the existing metrics.
Tracking the number of items in the cart or SKUs, as you suggested, sounds like it could provide some great insights! Thanks again!

Avatar

Community Advisor and Adobe Champion

Glad to help.

 

Also, I wasn't sure what cart tracking / flow code you had in place... I would be worried about breaking something there... 

 

Also, I see the cart tracking as more focused on "happy path", normal user behaviours... as opposed to catching errors. Especially if the issue seems to be tied to something that happens between user visits... 

 

Good luck trying to track down the issue! It doesn't sound good.

Avatar

Level 4

As @Jennifer_Dungansaid, there isn't anything out of the box for this. On every ecomm site I've worked on though, having an eVar for 'number of items in cart' as well as 'value of items in cart' has always been a standard addition as soon as we are able to convince the relevant teams to add it! Apart from the issue you are currently facing, it's extremely useful for passing to Target & then using to build Experiences, along the lines of 'you had this in basket, try this too' or the classic 'pick up where you left off' banner, or even just making sure that users with high value baskets are encouraged to convert. 

Avatar

Level 2

This usually needs some custom work. Out of the box, Adobe Analytics doesn’t have a simple metric to tell you if a user’s cart is empty when they come back. If your site supports a persistent cart (like Amazon does), then the cart is loaded from the server rather than just stored in the browser cookie, which can be updated on the Data Layer for Adobe Analytics to pick through Tag Managers. That gives you more reliable data and also avoids the customer frustration of carts being wiped. If the site is heavily on guest shopping and purchase and it would be a challenge.


One thing to keep in mind: clearing cookies can also reset the ECID, which breaks the visitor’s journey in Analytics (as a new ECID is created post cookie clear making pre and post cookie ECID different). If you’re using Customer IDs or a private graph, you can get around some of that disruption in data captured in Adobe Analytics reports.