if (typeof dataLayer !== "undefined") {
dataLayer.push({
"ecommerce": {
"currency": "USD",
"impressions": [
{
"id": "46220",
"name": "Madone SL 7 Gen 8",
"price": "8999.99",
"brand": "Trek",
"category": "Performance road bikes",
"variant": "grey",
"list": "CATEGORY",
"position": 1
}
,
{
"id": "46218",
"name": "Madone SL 5 Gen 8",
"price": "4949.99",
"brand": "Trek",
"category": "Performance road bikes",
"variant": "blue",
"list": "CATEGORY",
"position": 2
}
,
{
"id": "46219",
"name": "Madone SL 6 Gen 8",
"price": "7899.99",
"brand": "Trek",
"category": "Performance road bikes",
"variant": "red",
"list": "CATEGORY",
"position": 3
}
]
}
});
} else {
console.log("dataLayer");
}