magento - Tracking orders which placed using a specific button -


i trying track orders in google analytics placed after cliking on specific button.

to more specific there 'upgrade' button each of product on listing page. requirement is, need track orders placed result of clicking upgrade button.

any suggestion how can track these type of orders?

look google analytics "event tracking" see if applicable.

the following code snippet enables tracking add-to-cart events.

<button type="button" id="gat-<?php echo $_product->getid(); ?>" title="<?php echo $this->__('add cart') ?>" class="button btn-cart" onclick="productaddtocartform.submit(); submitgatrack(); return false;"><span><span><?php echo $this->__('add cart') ?></span></span></button>  <?php $gatsku = preg_replace("/[^a-za-z0-9-\s]+/", "", $_product->getsku()); $gatname = preg_replace("/[^a-za-z0-9-\/\s]+/", "", $_product->getname()); $gatprice = intval($_product->getprice()); ?>  <script type="text/javascript">     function submitgatrack() {     _gaq.push(['_trackevent', 'addtocart', '<?php echo $gatsku; ?>', '<?php echo $gatname; ?>', <?php echo $gatprice; ?>, true]);     } </script> 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -