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>