🇺🇦 We're working: Mon-Fri: 09:00-18:00 (Kyiv) Telegram Viber whatsapp
Kiev / Odessa (Ukraine):+38-098-887-05-49

^C7A9D471B0C1628AB4B2409A80063FCFD699D26916589903E6^pimgpsh_thumbnail_win_distr

 Ecommerce in Google Analytics has long been a must-have and the main tool for tracking the effectiveness of online marketing. In order to avoid mistakes in setting up e-commerce, you need to know and take into account many details. In most cases, they turn to specialists for this, but in order to be sure of the correct setting, you should read this article. 

 

For online store owners or online marketers, e-commerce allows you to find out which advertising channel works best, where the ROI is higher, the average check is more expensive, the cost of attracting a lead or the cost of an already attracted client is lower, and much more.

But in connection with the installation of e-commerce, various kinds of problems arise. The most popular two are:

  1. business owners do not always want to transfer full access to the site to the Internet marketing agency, and they want the improvements to be done by their programmers. Only such “own programmers” in 90% cases do not know how to install e-commerce correctly and make various mistakes during the installation process.
  2. even if you have installed analytics from a seemingly versed specialist, not all data can be transferred correctly, since there are very few qualified experts in installing and configuring Google Analytics, and therefore not everyone “seemingly versed” is familiar with a large number of nuances and is able to save you from setup errors.

 

 

After placing an order

there is a confirmation page and GTM is installed

 

 Let's assume that after placing an order, the customer gets to the success.html page. In order for transaction data to be sent to Google Analytics, it is necessary to place a JavaScript code in the code of this page that will transfer this data. The following is an example that is used in Russian GTM documentation.

 

How to independently install e-commerce on the site After placing an order, there is a confirmation page and GTM is installed Let's assume that after placing an order, the client gets to the success.html page. In order for transaction data to be sent to Google Analytics, it is necessary to place a JavaScript code in the code of this page that will transfer this data. The following is an example that is used in the Russian GTM documentation.

After checkout there is a confirmation page and GTM is installed

 

Be sure to remember that this code must be placed before Google Tag Manager code snippet so that the dataLayer object is already populated by the time the Google Analytics tag is activated.

 Consider the variables that are used to pass data:

  • transactionId* — unique transaction identifier
  • transactionAffiliation - partner or store
  • transactionTotal* — total transaction amount
  • transactionTax - tax
  • transactionShipping — shipping amount
  • transactionProducts - list of products purchased in this transaction
    • sku — product identifier (article)
    • name* — product name
    • category — product category
    • price* — price per item
    • quantity* — product quantity

 All variables marked with * are mandatory.

 

 

Used by Universal Analytics without GTM

 

 If for some reason you decide not to use Google Tag Manager on your site, then to send transactions to Google Analytics, you need to add the following code to the confirmation page:

 

How to install e-commerce on your site on your own Using Universal Analytics without GTM If, for some reason, you decide not to use Google Tag Manager on your site, then to send transactions to Google Analytics, you need to add the following code to the confirmation page:

 

 

The order form is submitted asynchronously and GTM is installed

 

 The question arises, what to do when there is no confirmation page when placing an order? In this case, the data is sent to the server without reloading the page. In order for the transaction to still be included in the analytics, you must perform the following steps:

1. Fill dataLayer in the same way as shown above: 

How to independently install e-commerce on the site The order form is sent asynchronously and GTM is installed The question arises, what to do when there is no confirmation page when placing an order? In this case, the data is sent to the server without reloading the page. In order for the transaction to still be included in the analytics, you must perform the following steps: 1. Fill in the dataLayer

 

     2. Add the following to the success ajax callback function:   

How to independently install e-commerce on the site The order form is sent asynchronously and GTM is installed The question arises, what to do when there is no confirmation page when placing an order? In this case, the data is sent to the server without reloading the page. In order for the transaction to get into the analytics, you need to do the following: 2. Add the following to the ajax callback function success: The order form is sent asynchronously and GTM is installed The question arises, what to do when there is no confirmation page when placing an order? In this case, the data is sent to the server without reloading the page. In order for the transaction to still be included in the analytics, you must do the following: The name of the event can be arbitrary. For its part, the analyst sets up e-commerce triggering exactly when the transaction event is fired.

 

The name of the event can be arbitrary. For its part, the analyst sets up e-commerce triggering exactly when the transaction event is fired.

 

 

Universal Analytics + AJAX

 

 In the case where the checkout form is submitted without reloading the page and using only Universal Analytics, the action to add data is very close to what we did in the second paragraph. The only exception is that the line Universal Analytics + AJAX In the case where the checkout form is submitted without reloading the page and using only Universal Analytics, the action to add data is very close to what we did in the second paragraph. The only exception is that line 5 needs to be added to the success ajax callback. you need to add success callback to ajax.

 

Author: web-programmer of the StarMarketing agency of strategic Internet marketing Ekaterina Demyanchuk


About the author - Vadim Steblinsky

English