How to implement e-commerce conversion tracking on the website side?

Building a Data-Driven World at Japan Data Forum
Post Reply
mstlucky8072
Posts: 31
Joined: Mon Dec 09, 2024 3:46 am

How to implement e-commerce conversion tracking on the website side?

Post by mstlucky8072 »

In order for transaction data to start appearing in Google Analytics reports, we need to send the appropriate data from the website, for example, after a purchase, we need to send transaction data, such as: its ID and amount (these variables are required). We can also send other valuable variables, such as shipping costs, products that were involved in a given transaction, and many others.

There are three methods by which you can implement website-side e-commerce monitoring, which are discussed below.

1. Plug-in Implementation - Overview, Pros and Cons
The easiest way to implement e-commerce at the page level is through various types of plugins, thanks to which data is transferred to Google Analytics. Implementation with this method involves only installing the plugin and its simple configuration. Below I will present the configuration using the example of Wordpress with the Woocommerce module and the “WooCommerce Google Analytics Integration” plugin.

The first thing you need to do is install the plugin. To do this, go to the plugins>add new tab in the WordPress administration panel, type the plugin you are interested in in the search field, i.e.: "WooCommerce Google Analytics Integration" and click "Install now". Then, after installation, activate the plugin.

This process is outlined below.

e-commerce plugin installation in WordPress

Installing the e-commerce plugin in WordPress.

Once the plugin has been installed correctly, in the next step go to the WooCommerce>Settings>Integration tab, then enter the UA tracking code ID and check “Enable Universal Analytics”.

plugin configuration

Plugin configuration.

Once the “Enable Universal Analytics” option is checked, the following options will appear below, as shown in the screenshot below. Check them and save the changes.

e-commerce tracking setup in plugin

Configuring e-commerce tracking in the plugin.

After this configuration, Google Analytics should start 99 acres database collecting data for the e-commerce module.

Image


Advantages of Plug-in Implementation
One of the most important advantages is that thanks to the plugin, you can quickly implement tracking on your own.

Disadvantages of plugin implementation:
free plugins usually have limitations and because of that we only have access to some of the reports,
no possibility to edit data that the plugin sends to Google Analytics,
if the plugin has poor documentation, we don't fully know what data is being sent (e.g. whether the transaction amount includes tax and shipping).
2. Implementation using codes - overview, advantages and disadvantages
The second method is for the developer to implement the appropriate tracking codes in the page template. For example, if we want to pass information about a transaction to GA, the developer must place the appropriate code that will execute when the transaction is charged. Most often, this is a thank you page for a purchase. Below is the basic code that passes the transaction data.

sample code for passing transaction data to GA

Sample code passing transaction data to GA.

Advantages of implementation using codes
we can send only the information we want to the e-commerce module, e.g. if we want to track adding products to the cart, displaying a product, etc., the programmer implements the codes in the appropriate places in the template and thanks to this we have the information we need,
we know what exactly is being tracked, e.g. whether the transaction amount includes tax, whether it is a gross or net amount.
Disadvantages of code implementation:
this method is very time consuming,
programmer assistance is required.
Implementation using GTM - Overview, Pros and Cons
The third method by which we can transfer e-commerce data is to read the appropriate values ​​from the page source in GTM and pass them to GA. With GTM we read the appropriate values ​​from the page, using javascript or jQuery, and then the data read in this way can be passed to GA. There is no general rule on how to read data from the page, because it depends on the structure of the specific website, but most often the data is read using CSS selectors, element class names or element ids.

Advantages of implementing using GTM:
you don't need to change anything in the page template,
they can be implemented without the help of a programmer,
we know what exactly is being tracked because we know what we have implemented.
Disadvantages of implementing using GTM:
this method is time consuming,
it is not always possible to track what we want, e.g. we want to transfer the amount of the transaction, but the thank you page does not provide the amount (only the inscription "thank you for the purchase" is displayed).
The most common errors that occur if a module is implemented incorrectly
One of the basic errors that occurs with poor implementation of e-commerce tracking is duplication of transactions (the code is executed several times, as a result of which a given transaction is charged multiple times), e.g. the transaction amount is PLN 100, when the code is executed 3 times, GA will charge the amount of this transaction 3x100, i.e. PLN 300. Below is an example report screenshot, which shows multiple duplication of transactions.

duplicate transactions

Duplicate transactions.

The second serious mistake in implementing tracking is that the code is executed in the wrong place, e.g. the code that is supposed to be called when a product is added to the cart is executed when we click on the product.

Summary
Implementing e-commerce tracking for online stores is extremely important, because thanks to it we can optimize campaigns for individual products and significantly increase conversion. It is also important that incorrectly implemented tracking can significantly mess up our statistics and because of that, we can draw incorrect conclusions.
Post Reply