if (typeof dataLayer !== "undefined") {
dataLayer.push({
"ecommerce": {
"currency": "USD",
"impressions": [
{
"id": "36791",
"name": "Rail 5 Gen 3",
"price": "7399.99",
"brand": "Trek",
"category": "Electric mountain bikes",
"variant": "reddark",
"list": "CATEGORY",
"position": 1
}
,
{
"id": "35032",
"name": "Rail 5 Gen 2",
"price": "7399.99",
"brand": "Trek",
"category": "Electric mountain bikes",
"variant": "red_greydark",
"list": "CATEGORY",
"position": 2
}
,
{
"id": "32844",
"name": "Powerfly 4 Gen 3",
"price": "4999.99",
"brand": "Trek",
"category": "Electric mountain bikes",
"variant": "grey_black",
"list": "CATEGORY",
"position": 3
}
]
}
});
} else {
console.log("dataLayer");
}