GTM 可以为电子商务交易使用预定义的宏名称,如下所示:
<script>
dataLayer = [{
'transactionId': '1234',
'transactionDate': '13112012',
'transactionType': 'Type 1',
'transactionAffiliation': 'ACME Clothing',
'transactionTotal': 25.60,
'transactionShipping': 5.00,
'transactionTax': 1.00,
'transactionPaymentType': 'Paypal',
'transactionCurrency': 'EUR',
'transactionShippingMethod': 'Store pickup',
'transactionPromoCode': '',
'transactionProducts': [{
'id': '12',
'name': 'Red leather boots',
'sku': '45622LTHRBOOTS',
'category': 'Shoes > Boots',
'price': 450.00,
'quantity': 2
},
{
'id': '14',
'name': 'Black leather jacket',
'sku': '456VESRTE',
'category': 'Clothing > Jackets',
'price': 750.00,
'quantity': 1
}]
}];
</script>