我已在以下格式的PDP和Cart页面上编写了数据层,以便在Adobe DTM for Adobe Analytics中使用。
<script>
var datalayer = {
transaction: {
transactionID: “<Transaction-ID>”,
zipCode: “<Zipcode>”,
paymentMethod: “<Payment Type>”,
shippingMethod: “<Ship-Method>”,
shippingCity: “<City>”,
shippingState: “<State>”,
total: {
basePrice: <base-amount>,
},
item: [{
productInfo: {
productName: " <product-name> ",
productID: "<product-id>",
productCategory: “<product-category>”,
producQuantity: <Quantity>,
basePrice: <Price>,
},
},
{
productInfo: {
productName: " <product-name> ",
productID: "<product-id>",
productCategory: “<product-category>”,
producQuantity: <Quantity>,
basePrice: <Price>,
},
]}
}
};
</script>
我想重复使用相同的数据层进行GA增强型电子商务跟踪。我去了GTM帮助,他们为GTM定义了一种格式的数据层格式。请使用上面的代码帮助您了解如何实现增强的电子商务跟踪。