if (typeof dataLayer !== "undefined") { dataLayer.push({ "ecommerce": { "currency": "NZD", "impressions": [ { "id": "40888", "name": "Electra MIK Rear Rack", "price": "149.99", "brand": "Electra", "category": "Bike racks", "variant": "greylight", "list": "CATEGORY", "position": 1 } , { "id": "33768", "name": "Electra Reflective Charcoal Phone Bag", "price": "89.99", "brand": "Electra", "category": "Phone & tablet accessories", "variant": "reflective", "list": "CATEGORY", "position": 2 } , { "id": "35952", "name": "Electra Pinger Bike Bell", "price": "34.99", "brand": "Electra", "category": "Bike bells & horns", "variant": "gold", "list": "CATEGORY", "position": 3 } ] } }); } else { console.log("dataLayer"); }