Need help implementing Google Analytics Code to track C5 E-Commerce transactions
PermalinkShould be very doable
Most platforms have add-ons specifically for this, such as WooCommerce on WP but it's not hard, basically adding a JS on the product pages such as:
ga('ecommerce:addItem', { 'id': '1234', // Transaction ID. Required. 'name': 'Fluffy Pink Bunnies', // Product name. Required. 'sku': 'DD23444', // SKU/code. 'category': 'Party Toys', // Category or variation. 'price': '11.99', // Unit price. 'quantity': '1' // Quantity. });
... with the variable values populated by the CMS, such as in PHP like:
ga('ecommerce:addItem', { 'id': '<?= $id ?>', // Transaction ID. Required. 'name': '<?= $name ?>', // Product name. Required. 'sku': '<?= $sku ?>', // SKU/code. 'category': '<?= $category ?>', // Category or variation. 'price': '<?= $price ?>', // Unit price. 'quantity': '<?= $quantity ?>' // Quantity. });
...it's a push event written out by your server-side scripting server generating the JS which is then triggered by the user action