Tracking ecommerce in piwik
-
Hello,
I am trying for more than one week to make jigoshop eccommerce working with piwik analytic platform.. unfortunately there is no plugin plugin to make this happen like for magento, prestoshop, etc..
and because i am not a programmer i tried very hard to guess the correct functions for different parameters (eg product id, cart totals, etc).
As per cart-update tracking (when a product is added to cart) I am stuck on getting the product quantity from the cart.
On single_product.php i put this code
<?php $plm=jigoshop_cart::get_cart_contents_total_excluding_tax(); if ($plm > 0){ ?><script type="text/javascript"> _paq.push(['addEcommerceItem', '<?php echo $_product->get_sku(); ?>', '<?php echo $_product->get_title(); ?>', ,<?php echo $_product->get_price(); ?>, '<?php echo $item['qty']; ?>' ]); _paq.push(['trackEcommerceCartUpdate', <?php echo jigoshop_cart::get_cart_contents_total_excluding_tax(); ?> ]); _paq.push(['trackPageView']);</script> <?php
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]
This code is working fine, i get the cart update in piwik with the new total value and everything, but i cant get the quantity from the cart..i believe i tried like a monkey more than 100 different functions/php statements to fetch that quantity, with no luck ??
Also, i am wondering, if there are more than 1 product in cart, how to get the corect quantity for each one? Like the cart widget is displaying
Thank you very much
- The topic ‘Tracking ecommerce in piwik’ is closed to new replies.