I'm trying to calculate the value of the shopping cart based on data contianed in the GTM datalayer ecommerce object. I'm bringing the entire ecommerce object into a datalayer variable so I can work with it in the custom js variable, but I'm unable to make the recursive calculation work. Here's an example of code from the datalayer: { "event": "checkout", "ecommerce": { "checkout": { "products": [ { "name": "coat", "id": "14M", "quantity": 1, "price": "100.00" }, { "name": "pants", "id": "12L", "quantity": 3, "price": "50.00" } ] } } }` My goal is to identifies the number of products in the