dominicwatts / googleecommercetracking
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: ~7.0.0||~7.1.0||~7.2.0||~7.3.0
- magento/framework: *
This package is auto-updated.
Last update: 2024-11-16 05:53:14 UTC
README
Add ecommerce:addTransaction
and ecommerce:addItem
on checkout
Install instructions
composer require dominicwatts/googleecommercetracking
php bin/magento setup:upgrade
php bin/magento setup:di:compile
Useage
Complete purchase. Check analytics.
<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>