Skip to content

Analytics

How to set up GA4 for a store so the data is useful, not just pretty

Read the articleQuestions and answers

Article cover: How to set up GA4 for a store so the data is useful, not just pretty

GA4 in an online store should help make decisions about the offer, traffic and the purchase funnel, not just draw aesthetically pleasing charts. If the configuration does not connect user behaviour with revenue, reports quickly become a decorative element of the dashboard. A good configuration starts with defining which business questions the store should answer using the data. Only then is it worth designing events, parameters and the way they are sent to GA4. In practice, two foundations determine measurement quality at the earliest stage: the analytics objective and a correctly designed Data Layer.

How to define the business objective of analytics for an online store?

The business objective of analytics for an online store is defined through the decision-making questions that the data is meant to answer. First, determine what you want to improve: category structure, funnel effectiveness or the quality of customers from specific sources. Such questions immediately show which data you really need and which will only clutter the implementation.

E-commerce overview in Matomo: an orders chart and tiles with revenue, number of orders, average value and conversion rate
Example In a single view: revenue, number of orders, average order value and conversion — four figures from which sales assessment begins. Public Matomo demo (sample data), own screenshot

The business objective determines the KPI that should be monitored on an ongoing basis. If the store is fighting for profitability, growth in sessions alone means little without revenue, CAC and average order value. If the problem is an unfinished purchase, the cart stages and abandonment rate will matter more. The choice of KPI then changes the event model, the scope of parameters and the reports used for analysis.

A clearly defined business objective also limits the typical mistake of trying to measure everything at once. A store does not need to track every click at the start if the key issue is understanding which categories attract the most valuable customers. It is better to begin with a few questions linked to revenue and purchase effectiveness, and only then expand the measurement. If organic traffic is important, the objective should cover not only visits, but also their quality and conversions.

The role of the Data Layer in an effective GA4 configuration

The Data Layer serves as the single, structured source of data from which GTM pulls information into GA4. It is not a technical add-on, but the foundation of the entire measurement setup. If the Data Layer lacks consistency, each tag starts interpreting the site differently and reports stop being comparable. That is why the Data Layer should be stable, predictable and documented in the same way for both the analyst and the developer.

In an effective GA4 configuration, the Data Layer must pass the same information in the same format on every page and at every stage of the purchase journey. In an online store this is particularly relevant for product and transaction data, such as the identifier, name, price, currency and quantity. If these values change structure between the listing, the product page and checkout, funnel analysis stops being reliable. This problem is not always visible straight away, but later it makes it impossible to compare stages of the purchase journey.

In practice, the Data Layer is a contract between developers and analysts. The analyst defines which events and parameters are needed, and the developer exposes them in the agreed structure. This means changes to the store interface do not have to break measurement in GTM immediately. The less guessing logic there is in GTM, and the more explicit data there is in the Data Layer, the more useful and stable the reports are. Documenting the fields and the moments they are sent saves time during implementation, testing and later expansion.

How to configure Google Tag Manager for GA4 correctly?

Google Tag Manager for GA4 is configured so that it reads unambiguous data from the Data Layer and turns it into consistent events. In practice, GTM should not guess what happened on the site, but react to explicit signals from the data layer. This means changes in the store’s appearance do not break measurement. This is especially important in an online store, where the listing, product page and checkout are often developed separately.

The basis is correct mapping of the data model to GA4 events. First, set up the GA4 configuration tag, and then separate event tags for key purchase actions. Each tag should pull parameters from the Data Layer via GTM variables, not from text visible in the interface. The fewer dependencies there are on page elements, the lower the risk of silent errors after front-end changes.

In practice, it is best to fire tags through your own Data Layer events, for example for product view, add to cart or purchase. This setup gives you control over the send timing and limits duplicates. It is also worth keeping the naming of events and parameters consistent from the outset, because tidying up GA4 later is costly. GTM is meant to be the implementation hub, but the business logic should come from the agreed data model, not from random rules in the container.

Key e-commerce events and their parameters in GA4

The key e-commerce events in GA4 are the ones that show the transition from browsing the offer to making a purchase. The essential minimum includes view_item_list, view_item, add_to_cart, begin_checkout, add_shipping_info, add_payment_info and purchase. This set makes it possible to see where the user drops off and which stages are really limiting sales. Without it, the store sees the final result, but does not understand where the loss comes from.

During implementation, it is worth keeping an eye on the role of each event. view_item_list shows the effectiveness of listings and categories, while view_item says which product pages attract attention. add_to_cart measures genuine interest in the offer, and checkout events reveal whether the problem lies with delivery, payment or the finalisation process itself. purchase closes the funnel and connects user behaviour with revenue.

Same event names are not enough, because the usefulness of reports depends on parameters. Stable item_id, item_name, price, currency and quantity are critical, because without them you cannot compare products, basket value or revenue. Additional context is provided by item_brand, item_variant, item_category, coupon and transaction_id. transaction_id in particular must be unique, because only then can you distinguish a genuine purchase from an incorrectly duplicated event.

If you want to better understand post-purchase behaviour or revenue adjustments, add remove_from_cart and refund as well. They are not essential at the start, but they help assess the quality of the offer and the real value of sales. The most common mistake is implementing a nice-looking funnel without value, currency or stable product identifiers. In that case the report looks correct, but it is not suitable for decisions about the product range, SEO or budget.

The importance of User-ID tracking for customer journey analysis

User-ID lets you analyse a customer as one person across different devices, rather than as a series of disconnected sessions. This is especially important in an online store, where the user often browses the offer first and buys later and elsewhere. It makes it easier to assess the full path to purchase and metrics such as LTV. Without User-ID, GA4 more often shows fragments of behaviour than the customer’s real history.

Implementation makes sense when the store has logins and can assign a stable identifier to a logged-in user. That identifier should be passed consistently after sign-in so that GA4 can connect subsequent visits. If the identifier is sent one time and not the next, the customer journey will be fragmented. User-ID does not replace correct event measurement; it extends it with the perspective of a specific customer.

The biggest benefit comes when analysing revenue sources and the behaviour of returning users. You can then better assess which activities attract customers who come back later, not just those who convert in a single session. This helps you interpret assisted paths and the value of traffic that only closes after several touchpoints more sensibly. However, if most purchases happen without logging in, the scope of this analysis will naturally be limited.

How to ensure data quality and completeness in GA4?

Data quality and completeness in GA4 are ensured by controlling noise, continuously validating the implementation and comparing the data with the store system. Correctly sending events is not enough if the reports are distorted by internal traffic, bots or attribution errors. In an online store, the issues that hurt most are those that distort transactions, revenue and sales sources. That is why quality control should be an ongoing process, not a one-off test after implementation.

The foundation is technical validation of every key event. Use DebugView to check the moment of sending, the full set of parameters and the logic of the funnel progression. Then compare the number of transactions and revenue with the store’s backend data. If purchase matches only in GA4 and not in the order management system, the problem is on the measurement side, not the sales side.

Pay particular attention to duplication of transaction_id and the presence of value and currency. A duplicated purchase inflates revenue and can falsely improve the conversion rate. Missing value or currency makes the report look complete, but it is not suitable for budget decisions. Equally dangerous are variable item_id values, because they prevent a fair comparison of product performance.

The completeness of the data is also affected by the limitations of the measurement environment itself. Consent Mode affects how much data GA4 can collect directly and how much will be modelled. Ad-blockers limit the recording of some users, so the numbers in GA4 will not always be a full reflection of the store’s traffic. Thresholding and sampling can also change how reports are read, so it is important to know when you are looking at complete data and when at limited data.

In practice, it is worth continuously monitoring a few sources of distortion:

  • internal traffic from the team and developers,
  • bots generating artificial sessions,
  • UTM loss during the transition to payment,
  • incorrect referrals from your own domains and payment gateways,
  • inconsistent operation of Consent Mode.

These elements directly affect attribution and the assessment of channel effectiveness. If the store does not exclude referrals from the payment gateway, GA4 may assign sales to the wrong source. If the team tests checkout in production without filters, the data will start showing fictitious purchases. The most useful reports are created when GA4 is regularly confronted with the reality of the store, not just with its own dashboard.

The most common configuration mistakes in GA4 and how to avoid them

The most common mistakes in GA4 configuration for an online store are duplication of the purchase event, missing value and currency parameters, variable item_id, loss of UTM and counting developer traffic. Each of them breaks a different part of the analysis, but together they lead to the same effects: an incorrect assessment of sales, channels and products. The problem is that a report may look credible despite flawed foundations. In an online store, data that are partially correct are more dangerous than obviously broken data, because it is easy to make the wrong decision based on them.

The most damage is caused by mistakes that directly affect revenue and attribution. In practice, it is worth focusing primarily on these points:

  • purchase must not be sent multiple times for the same transaction_id, because it will inflate revenue and the number of orders,
  • purchase events must have value and currency; otherwise revenue analysis and channel comparison lose their purpose,
  • item_id should be stable, because variable identifiers split a product’s history into several entities,
  • UTM tags must not be lost during the transition to payment, because sales will be assigned to the wrong source,
  • team and developer traffic must be separated, because tests can artificially improve the funnel.

Avoiding these mistakes requires simple implementation rules and regular checks. The purchase event should be tied to a real transaction confirmation, not just to opening the thank-you page. Transaction and product parameters should come from one consistent data source, not from ad hoc exceptions in GTM.

Traffic sources need to be protected just as much as revenue itself. If the store uses its own auxiliary domains or payment gateways, a lack of correct referral and cross-domain configuration will distort attribution. As a result, SEO, campaigns and direct traffic may look better or worse than they actually are.

The most effective method is to test after every change in the product page, basket and checkout. Check the event flow in DebugView, then compare transactions and revenue with the store backend. If these two sources no longer match up in a sensible way, fix the measurement first, and only then interpret the results.

FAQ

Frequently asked questions

How do you define the analytics goal in an online store for GA4?

The goal is defined by the decision questions the data should answer, for example about funnel effectiveness, product categories or the quality of traffic from specific sources. This makes it clear which data is needed and which would only clutter the implementation.

Do you need to track every click in GA4 in a store?

No, at the beginning it is not worth measuring everything at once. It is better to start with a few questions linked to revenue and purchase effectiveness, and only then expand the measurement.

Why is the Data Layer so important when configuring GA4?

The Data Layer is a structured source of information from which GTM pulls data into GA4. If it is inconsistent, reports stop being comparable and funnel analysis loses credibility.

Which e-commerce events are worth implementing in GA4 first?

The basic set is view_item_list, view_item, add_to_cart, begin_checkout, add_shipping_info, add_payment_info and purchase. This setup shows at which stage users drop off and what limits sales.

When is it worth implementing User-ID in GA4 for a store?

It makes sense when the store has login and can assign a stable identifier to a logged-in user. This makes it possible to connect visits across different devices and better assess the full path to purchase.

How can you check whether data in GA4 for a store is complete and reliable?

You need to validate events in DebugView and compare transactions and revenue with the store backend. It is also worth checking internal traffic, bots, UTM loss, redirects from payment gateways and the consistency of Consent Mode.

Contents