概述
if (typeof dataLayer !== "undefined") {
dataLayer.push({
"ecommerce": {
"currency": "CNY",
"impressions": [
{
"id": "41981",
"name": "Trek Sunset Script Beanie",
"price": "258.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "bluedark",
"list": "More Options",
"position": 1
}
,
{
"id": "37335",
"name": "Trek Diamond Patch Hat",
"price": "238.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "bluedark",
"list": "More Options",
"position": 2
}
,
{
"id": "40642",
"name": "Trek Bicycle Co 5 Panel Hat",
"price": "238.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "orange",
"list": "More Options",
"position": 3
}
,
{
"id": "37338",
"name": "Trek Script Beanie",
"price": "238.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "tan",
"list": "More Options",
"position": 4
}
,
{
"id": "45021",
"name": "100% Trek Factory Racing 5 Panel Hat",
"price": "258.0",
"brand": "100%",
"category": "Casual caps & hats",
"variant": "black",
"list": "More Options",
"position": 5
}
,
{
"id": "45020",
"name": "100% Trek Factory Racing 棒球帽",
"price": "258.0",
"brand": "100%",
"category": "Casual caps & hats",
"variant": "black",
"list": "More Options",
"position": 6
}
,
{
"id": "45022",
"name": "100% Trek Factory Racing 绒毛小帽",
"price": "258.0",
"brand": "100%",
"category": "Casual caps & hats",
"variant": "black",
"list": "More Options",
"position": 7
}
]
}
});
} else {
console.log("dataLayer");
}