dominicwatts / googleecommercetracking
1.0.0
2020-06-15 15:49 UTC
Requires
- php: ~7.0.0||~7.1.0||~7.2.0||~7.3.0
- magento/framework: *
This package is auto-updated.
Last update: 2024-09-16 05:29:26 UTC
README
在结账时添加 ecommerce:addTransaction
和 ecommerce:addItem
安装说明
composer require dominicwatts/googleecommercetracking
php bin/magento setup:upgrade
php bin/magento setup:di:compile
用法
完成购买。检查分析。
<script>
/* <![CDATA[ */
ga('ecommerce:addTransaction', {
'id': '000001234', // Transaction ID. Required
'affiliation': 'Main WebsiteMain Website Store', // Affiliation or store name
'revenue': '44.9800', // Grand Total
'shipping': '5.0000', // Shipping
'tax': '0.0000' // Tax
});
ga('ecommerce:addItem', {
'id': '000001234', // Transaction ID. Required
'name': 'PRODUCT', // Product name. Required
'sku': 'SKU', // SKU/code
'price': '39.9800', // Unit price
'quantity': '1.0000' // Quantity
});
ga('ecommerce:send');
ga('second.ecommerce:send');
/* ]]> */
</script>