Skip to main content
Analytics and BIE-commerce

Data Layer in Google Analytics eCommerce reports

By September 17, 2021January 31st, 2024No Comments

What is a Data Layer?

Do you know what Data Layer is and how important it is for enabling e-commerce reports generated through Google Analytics? If you have an e-commerce business, this content is very valuable for you!

The data layer is a part of the website that sits between the front-end and the back-end and is basically used to store any data deemed necessary in some context. It can appear as a list or vector of Javascript objects.

An abstraction for understanding the data layer concept is to think of a website as if it were a musical concert. A concert needs to be adjusted and several important points defined, such as the date and venue, audience, audiovisual equipment, security measures, stage, etc.

And it can be seen as the sum of three stages. The first is all the preparation done beforehand. The second is the work behind the scenes to ensure that preparation is carried out. And the third is the performance itself.

By understanding this, it is possible to look at a website through different eyes. The advance preparation represents the reason and/or function for which the site was created, the backstage represents the back-end, which is the part of the site that deals with databases, transactions and the system itself, and the artist's presentation would be the front-end, which is the visual part of the site that your user interacts with.

In this musical show example, the data layer would be the communication between backstage and the show. This is where important information would be passed on to the backstage area. If the songs are playing at the right time, if everything is okay with the equipment and the artist, how the audience is reacting to the performance, if there have been any accidents and all the things done to ensure that everything runs smoothly.

 

What is e-commerce?

E-Commerce is a feature of Google Analytics that makes it possible to obtain important data about the transactions made in an e-commerce site. These include: transaction value, products purchased, value and quantity of these products, among others.

It has two versions that differ in the information provided in their reports: the Conventional E-Commerce (or simply Electronic Commerce) and Advanced E-Commerce.

The conventional version allows reports with data such as overall revenue, conversion rate, number of transactions, average order value; revenue data, purchases, quantity, average price and average quantity of products (separated by ID or product category); revenue by date; revenue, tax, freight and quantity of products for each transaction; how many days and/or sessions are spent before a purchase is actually made.

The advanced version (which is the focus of this article) allows access to a much larger volume of information. It has the same data as the conventional version and some more. These include: number of impressions for internal promotions; number of transactions, revenue and average value for campaigns, coupons and memberships; number of sessions for each stage of the purchase funnel, determining how many went ahead and how many gave up at each stage; among others.

Activating e-commerce is very simple. In Google Analytics, the user must access the Administrator section, go to the View settings (third block of the page) and click on 'E-commerce settings'. The new page will open with an option 'Enable e-commerce' which is disabled by default.

When you click on the button, Conventional eCommerce will be activated. If you want to activate the advanced version, you must activate the second option which will appear immediately after activating the first. This is where you can configure the labels for the stages of the funnel, which must be present in the source code of the pages relating to these stages.

Finally, the user must click on the blue button 'Save' button button after making any changes to this page. After activation, you will need to wait a few hours for the data to start appearing.

What does one have to do with the other?

O data layer is capable of storing site data, usually determined by its developers based on some business need or rule. In the context of e-commerce, Google Analytics will scan the data layer of each of the online store's pages and generate reports based on the information available in it.

So it's no use just activating eCommerce, your data layer needs to be correctly configured to save this information.

Some e-commerce platforms have integration with Google Analytics and these make everything easier. All you have to do is copy and paste the Google Analytics property ID, check the related options, which are usually easy to understand, and voila, tracking is activated. However, when there is no possibility of integration or when the site is built "by hand", without using platforms, the data layer must be implemented manually.

This implementation should follow the pattern of Google's documentation (which specifies which codes should be used, where to use them and how to use them) found at at this link. And it should be done on all the important pages of the site, such as product pages and/or product categories, cart, payment steps, checkout, among others, as these pages will generate the data that feeds the reports of the advanced version of eCommerce.

 

Working example

Let's take another abstraction: it's as if Google Analytics were a restaurant, e-commerce were the kitchen where the orders are prepared and the data layer were the waiter. So, if the waiter doesn't write down on the order the comments made by the customer who, for example, doesn't want onions on his plate, the kitchen won't know and the order will probably be placed incorrectly.

E-commerce allows you to track and detail purchases made on the site. But in order for Google Analytics to be able to read them without problems, your information must be correctly arranged in the data layer. Therefore, care must be taken with Advanced eCommerce. Because it allows for a greater variety of information, its codes need to be installed on more pages and using greater detail.

It's worth noting that, even though the focus here is on Advanced eCommerce, a site with Conventional eCommerce will also need to have a correctly configured data layer. In the case of conventional sites, the implementation should only be done on the data layer of the purchase confirmation page and follow the pattern described in in this link.

Therefore, in order for the data on purchases made in your e-commerce to be properly monitored, make sure you have a correctly configured data layer and that you activate e-commerce in Google Analytics.

 

Some technical references:

https://blog.dp6.com.br/tudo-sobre-a-camada-de-dados-data-layer-cd2250638c6f

https://support.google.com/tagmanager/answer/6107169?hl=pt-BR

https://developers.google.com/tag-manager/enhanced-ecommerce?hl=pt_br

https://support.google.com/analytics/answer/1037249?hl=pt-BR

https://support.google.com/analytics/answer/6014872?hl=pt-BR

Did you like this article?

0 / 5 Results 0 Votes 0

Your page rank:

Pareto

Author: Pareto - Learn more about the world of AIs and Digital Marketing. Access our content collection now!