概述
if (typeof dataLayer !== "undefined") {
dataLayer.push({
"ecommerce": {
"currency": "CNY",
"impressions": [
{
"id": "47331",
"name": "Rapha Trail 6 板帽",
"price": "310.0",
"brand": "Rapha",
"category": "Cycling caps & headwear",
"variant": "black",
"list": "More Options",
"position": 1
}
,
{
"id": "41981",
"name": "Trek Sunset Script Beanie",
"price": "258.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "bluedark",
"list": "More Options",
"position": 2
}
,
{
"id": "41980",
"name": "Trek Oh Deer Beanie",
"price": "258.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "black",
"list": "More Options",
"position": 3
}
,
{
"id": "37335",
"name": "Trek Diamond Patch Hat",
"price": "238.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "bluedark",
"list": "More Options",
"position": 4
}
,
{
"id": "37338",
"name": "Trek Script Beanie",
"price": "238.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "tan",
"list": "More Options",
"position": 5
}
,
{
"id": "40642",
"name": "Trek Bicycle Co 5 Panel Hat",
"price": "238.0",
"brand": "Trek",
"category": "Casual caps & hats",
"variant": "orange",
"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
}
,
{
"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": 8
}
,
{
"id": "45020",
"name": "100% Trek Factory Racing 棒球帽",
"price": "258.0",
"brand": "100%",
"category": "Casual caps & hats",
"variant": "black",
"list": "More Options",
"position": 9
}
,
{
"id": "45023",
"name": "100% Trek Factory Racing 无檐小帽",
"price": "258.0",
"brand": "100%",
"category": "Casual caps & hats",
"variant": "black",
"list": "More Options",
"position": 10
}
]
}
});
} else {
console.log("dataLayer");
}