[英]how to correctly write a function
如何在谷歌标签管理器中为变量(自定义 javascript)正确编写函数? 由此:
function() {
'items': eshop.product.options.length === 0 ? [{
'id': eshop.product.id,
'google_business_vertical': 'retail'
}] : eshop.product.options.map(function (option) {
return {
'id': eshop.product.id.toString() + '_' + option.id,
'google_business_vertical': 'retail'
};
})
}
仍然有一些错误。 感谢帮助。
佩蒂曼
好,我知道了..
function () {
var prods = eshop.product;
return eshop.product.options.length === 0 ? [{
'id': eshop.product.id,
'google_business_vertical': 'retail'
}] : eshop.product.options.map(function (option) {
return {
'id': eshop.product.id.toString() + '_' + option.id,
'google_business_vertical': 'retail'
};
})
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.