How to get variables for tracking?

  • Posts: 13
  • Thank you received: 0
11 years 2 months ago #150173

-- HikaShop version -- : Essential 2.2.2
-- Joomla version -- : 3.2.3

In Google Analytics we would like to track the conversion of items in orders. In a tutorial I found the code below that should be placed on the thank-you-page. But how do I get the variables like transfer ID or the total price?

_gaq.push(['_addTrans',
'<?php echo trans_id; ; ?>',                                   // Ordernummer
'<?php echo 'Webwinkel Lotje'; ?>',                             // Naam webwinkel
'<?php echo trans_total; ?>',                               // Totaalbedrag bestelling
'<?php echo trans_tax; ?>',                                 // BTW
'<?php echo trans_shipping; ?>',                        // Verzendkosten
'<?php echo shipping_city; ?>',                           // Stad
'<?php echo shipping_state; ?>',                        // Provincie
'<?php echo shipping_country; ?>'                     // Land
]);

foreach ($items as $item} {
_gaq.push(['_addItem', 
'<?php echo trans_id; ?>',                                  // Ordernummer
'<?php echo $item_sku_code; ?>',                     // Artikelnummer
'<?php echo $item_name; ?>',                           // Productnaam
'<?php echo $item_category; ?>',                      // Categorie
'<?php echo $item_price; ?>',                            // Productprijs
'<?php echo $item_quantity; ?>'                        // Aantal
]);
}

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
11 years 2 months ago #150182

Hi,

You could simply configure the google analytics plugin that is available in the Business edition for that:
www.hikashop.com/support/support/documen...oogle-analytics.html
Otherwise, here is some information on adding custom code for tracking:
www.hikashop.com/forum/4-how-to/68067-tr...get-cart-values.html

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
11 years 2 months ago #150910

Thank you for the links. In the Business Edition is a Google plugin, but we are using the Essential version.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #150912

Hi,

If you really need this plugin, you can upgrade your version:
www.hikashop.com/extensions/upgrade-my-version.html

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum