Virtuemart 3 code to track order transaction in Google Analytic
October 13, 2017 Comments 1 338 Views

Virtuemart 3 code to track order transaction in Google Analytic

Virtuemart 3 is used to create eCommerce store using Joomla CMS. While working with eCommerce site there is always a requirement of tracking. The most used third party tracking is google analytics and it seems virtuemart 3 core does not have any inbuilt way to track the same.

Here is the tip and virtuemart code to track order transaction in google analytics.

First locate the file which is call when order is made successful and system show thank you message. Below is the location of file where it is done in Virtuemart 3.


To get the tracking work we need 2 types of third party google analytic code on page. On your page head tag you should have general analytic code like below.

For tracking transaction and products other code will look something like below.

Now to make it dynamic and call in your virtuemart open below file and strat adding the code as explained below.

Open file in editor => components/com_virtuemart/views/cart/tmpl/order_done.php

First you need to fetch order details in order_done.php file. Below is the code for same.

After fetching the order details below is the code to execute analytics javascript for tracking with dynamic data.

Altogether your order_done.php file will look like below with complete code.

Try this code and advice if you face any problem tracking the same so we can guide you further to make your eCommerce tracking work with Joomla / Virtuemart 3

Previous Wordpress Quiz for Experts
Next Get list of Images from a Folder using PHP

About author

Rio 37 posts

Expert web developer working in PHP, Wordpress, Joomla, Magento, Javascript etc.

You might also like

Joomla 0 Comments

Easy steps on how to Install Joomla on your server

Flexible and well coded content management system (CMS), which enables you to create Web sites and strong online applications. We will show you with step by step flow on how

Joomla 0 Comments

Security tips to protect joomla website from hackers

Protect joomla website from various hacking attempts which results because of various reasons like using of default database prefix jos__ , weak passwords or username, external plugin / components /

Joomla 0 Comments

Tips to Speed Up Your Joomla Website Performance

Know how you can increase the joomla website performance by speeding up the load time with the help of various tips and techniques. Speed of website has become important topic