Today we have a technical article in our blog, which is not often. And I was prompted to write it by the fact that quite often web analysts receive tasks on setting up e-commerce in Google Analytics. Usually, for this we use the standard and recommended by Analytics JavaScript code. However, this solution is sometimes not suitable: some orders are lost and are not displayed in analytics. For this, there is a second method of sending data to the analytics system, which I want to tell you about.

E-commerce reports in Google Analytics allow you to get data on completed purchases. What was purchased, for what amount, from what source they came and many other data.

 Example of an eCommerce report in Google Analytics


The most common method of sending data from a website to GA is installing a special JavaScript code in the shopping cart, at the last step of placing an order. It’s simple: information whatsapp number indonesia about the completed order, id, amount, composition, etc. is sent from the online store to analytics.

However, this solution has its drawbacks. For example, we periodically encounter the fact that orders are “lost”. In the admin panel there is, but not in analytics. TOP-5 reasons for this (provided that the code is installed and configured correctly):

  1. Features of the site itself. The code sometimes does not load, or users close the page too quickly.
  2. Cookie/JavaScript disabled. The percentage of such users is negligible, but it still happens.
  3. JavaScript does not work correctly. When there are errors in the JavaScript of the site itself.
  4. Poor connection between the provider and Google servers.
    It is quite possible that some clients have a poor internet connection, or the provider may filter traffic. Because of this, JavaScript data simply does not reach the servers collecting statistics, but again, the percentage of such users is small.

First, let’s look at the harmful solutions and advice that you can find on the Internet:

  1. Dynamically generate eCommerce code and send statistics before redirecting the user to the “Thank you for your purchase” page. For example, the user is on the checkout page. He enters all his data and after successful verification of the data on the server side by means of ajax, the generated eCommerce code is sent. First it is executed, and only after that the redirection to the “Thank you for your purchase” page occurs. Of course, it is better to discard this option.
  2. Somehow keep the user on the “Thank you Sad Life Box for your purchase” page. Also a very questionable solution.


Now let’s move on to the correct option. In such cases, there is a second method for setting up eCommerce for Google Analytics. In this case, the data will be sent not using js, but by means of php. You or your developers can read the description of this method at the link .

Leave a Reply

Your email address will not be published. Required fields are marked *