if (typeof dataLayer !== "undefined") { dataLayer.push({ "ecommerce": { "currency": "ZAR", "impressions": [ { "id": "41348", "name": "Domane SL 5 Gen 4", "price": "70000.0", "brand": "Trek", "category": "Performance road bikes", "variant": "black_grey", "list": "CATEGORY", "position": 1 } , { "id": "36152", "name": "Domane SL 6 AXS Gen 4", "price": "95000.0", "brand": "Trek", "category": "Performance road bikes", "variant": "bluedark", "list": "CATEGORY", "position": 2 } , { "id": "36746", "name": "Domane SL 6 Gen 4", "price": "80000.0", "brand": "Trek", "category": "Performance road bikes", "variant": "black", "list": "CATEGORY", "position": 3 } ] } }); } else { console.log("dataLayer"); }