Google Analytics 4 in PrestaShop: how to set it up properly
There are three ways to get Google Analytics 4 into PrestaShop: paste the tag, use a module or go through Google Tag Manager. We explain which one suits you, which ecommerce events matter, how to check they arrive, the usual mistakes (duplicated purchases or purchases lost at the payment gateway, consent) and why GA4 sees fewer sales than your shop.
To install Google Analytics 4 in PrestaShop you have three options: paste the Google tag into the theme, use a module or load it with Google Tag Manager. But GA4 counting visits is not enough: to measure a shop, the ecommerce events (view product, add to cart, begin checkout and purchase) have to arrive with their value, without duplicates and respecting cookie consent.
Many shops have GA4 «installed» and don't trust what they see: purchases don't match orders, or the ecommerce report comes up empty. It is almost always the configuration, not the tool. Here we explain how to set it up properly, how to check it without being a developer and what limits GA4 has even when it is perfect.
The three ways to add GA4 to PrestaShop
1. The Google tag pasted into the theme
GA4 gives you a snippet of code (the Google tag) that you paste into the header of every page. It is the quickest option and already measures visits and page views.
But the tag on its own knows nothing about your shop: not which product is being viewed, nor what is in the basket, nor how much an order is worth. Each event has to be coded into the theme templates, and that work breaks when you change or update the theme.
2. A PrestaShop module
A module hooks into the points where the shop already knows the data (the product page, the basket, the checkout, the order confirmation) and sends the events with their products, quantities and values. It is the most convenient option if you don't want to touch code.
Before installing one, check that it is compatible with your PrestaShop version and your theme, which events it sends, whether it respects cookie consent and whether anyone maintains it. An abandoned analytics module looks as if it works while it stops sending data.
3. Google Tag Manager
With Tag Manager you install a single container in the shop and, from its dashboard, configure the tags for GA4 and the other platforms (Meta, Google Ads, TikTok). It is the natural choice if your agency already works with it.
But Tag Manager doesn't make up the data: it needs the shop to publish a data layer (dataLayer) with the product, the basket and the order on every page. That has to be done by a module or by custom development in the theme. And you have to maintain two things instead of one: the shop's data layer and the container configuration.
Which one to choose
| Your situation | What usually fits |
|---|---|
| You only want to know how many visits you get | Google tag |
| You want GA4 ecommerce without touching code | Module |
| You have an agency or team that already manages several tags with Tag Manager | Tag Manager with a reliable data layer |
| As well as GA4 you run campaigns on Meta, Google Ads or TikTok and you need them to see purchases | A module that also sends from the server |
The ecommerce events that matter
GA4 has a list of recommended events for online shops, with fixed names. If they are sent with those names and their parameters, GA4 places them in its ecommerce reports and in the purchase funnel. If you invent other names, the data arrives but doesn't appear where it should. The essentials:
| Event | When it is sent | What it tells you |
|---|---|---|
view_item_list | The customer views a category or a list of results | Which listings generate interest |
view_item | Opens a product page | Which products are viewed and which are bought |
add_to_cart | Adds a product to the basket | Products that attract interest but don't sell |
begin_checkout | Starts the checkout process | How many baskets reach payment |
add_shipping_info and add_payment_info | Chooses the carrier and payment method | At which checkout step people drop out |
purchase | Order confirmed | Sales, revenue and which campaigns they come from |
Of all of them, the one to look after most is purchase. It must carry the transaction ID (the order reference or number), the value, the currency, tax and shipping if you want to see them separately, and the list of products. Also decide, and always keep the same, whether the value includes VAT and shipping costs: if it is sent one way one month and another way the next, comparisons are worthless.
Also check that each product is identified with the same reference in every event: if the product page sends one identifier and the purchase another, GA4 cannot link what was viewed with what was sold.
How to check the data is arriving
You don't need to know how to code to check it. Always do it after installing something, changing theme or updating PrestaShop:
- Realtime report. Open GA4, go to the realtime report and browse your shop from another browser: view a product, add it to the basket, begin checkout. Within a few seconds the events should appear with their names.
- DebugView. In the GA4 admin section there is DebugView, which shows the events from one device one by one, with all their parameters. You can enable it, for example, with Tag Manager preview mode or with Google's Tag Assistant. There you can see whether
purchasecarries the right value and products. - A real test order. Place an order with the payment method your customers use most, not just bank transfer. Check that a single purchase appears, with the exact amount and the order reference.
- The next day, compare. GA4's standard reports take a while to fill in. After a few hours, compare that day's GA4 purchases with the valid orders in the PrestaShop back office.
Repeat that comparison every month. The figures won't match exactly (we explain why below), but if the gap suddenly widens, something has broken.
Typical GA4 mistakes in PrestaShop
Duplicated purchases
There are three usual causes: two systems sending the same thing (module and Tag Manager, or module and tag in the theme), the confirmation page being reloaded or reopened from the browser history or from an email and sending the purchase again, and purchases sent without a transaction ID. With the ID, GA4 can recognise a repeated purchase; without it, every send counts as a new sale. The fix: a single sending route and the ID always present.
Purchases lost at the payment gateway
With many gateways the customer leaves your shop to pay on the bank's or the payment provider's website. If they then close the tab without returning to the «thank you for your order» page, the purchase event is never sent, because it normally fires from that page. The order exists in PrestaShop, but GA4 never finds out.
There is a second problem: when the customer does return, GA4 may attribute the purchase to the gateway's website as if it were the traffic source, and the sale no longer shows up as coming from Google Ads or the email campaign. To avoid this, the GA4 admin has a list of unwanted referrals where you add the domains of the gateways you use.
Cookie consent
In Europe, GA4 must not store analytics cookies unless the customer accepts them. If the cookie banner is not connected to GA4, either everyone is measured without permission (a legal problem) or nobody is measured even when they accept. The right approach is to set up Google Consent Mode v2: the banner passes on the customer's choice and GA4 adapts. Check it in DebugView by accepting and rejecting.
Other faults we see often
- The wrong measurement ID, for example the one from a test site or a previous shop.
- Events that stop being sent after a theme change, because they were coded into the old theme's templates.
- Cancelled or refunded orders that still count as a sale in GA4, while in the shop they no longer do.
Why GA4 sees fewer sales than the shop, even when it is set up correctly
With everything configured correctly, GA4 will still show fewer purchases than the back office. That is normal, and it is worth understanding why before hunting for a fault that doesn't exist:
- Ad and tracking blockers. Many block the Google tag. The purchase exists, but the signal never leaves the browser.
- Rejected cookies. If the customer doesn't accept, GA4 doesn't measure them with cookies, and that purchase doesn't appear as such in the reports.
- Browsers that cut cookies short. Some limit how long a cookie lasts, and GA4 stops recognising that the person buying today is the one who arrived from a campaign days ago.
- The confirmation page that is never seen, as with payment gateways.
And it is not just a reporting problem: if you decide which campaigns to keep using that data, you are deciding with only part of your sales. The bidding algorithms of Google Ads and Meta also learn from the conversions they receive: with less data, they optimise worse and each sale looks more expensive.
The way to narrow that gap is server-side analytics: the shop's server, which knows for certain when there is an order, sends the purchase to GA4 and the other platforms, without depending on the browser. It is combined with sending from the browser, with a shared identifier so that each purchase counts once. It is not a shortcut to get around consent: what is recovered are purchases lost for technical reasons.
How to solve it in PrestaShop
The RKR API Conversions Pro module, which appears in the shop as «Conversions API for PrestaShop: server-side Meta, GA4 and Google Ads», captures the events of the whole funnel, from the product listing to the purchase, and signs them before sending them. It is compatible with PrestaShop 1.7.8 to 9.2 and sends to GA4, Meta, Google Ads, TikTok and other platforms from the same installation. It includes Consent Mode v2 with adapters for several common cookie managers, a wizard that guides you platform by platform with a «Save and test» button that sends a real event, health traffic lights and a daily reconciliation that compares orders with each platform's deliveries.
Server-side delivery is handled by RKR Relay, our server-side analytics service for PrestaShop: it receives the shop's events and delivers them to each platform with an encrypted queue, retries and the status of every delivery, and only hashed identifiers travel to the relay. There are three plans depending on events per month, at €19, €39 and €79 a month + VAT, with no minimum term, with module installation and configuration included. If what you need is someone to review why your GA4 doesn't add up before changing anything, you can also request it with a block of PrestaShop support hours.
Frequently asked questions
How do I install Google Analytics 4 in PrestaShop?
With the Google tag in the theme, with a module or with Google Tag Manager. For a shop, the practical choice is a module that sends the ecommerce events, using only one of the three routes.
Why doesn't GA4 record my shop's purchases?
The most common causes are that the purchase event isn't sent, that the customer doesn't return from the payment gateway to the confirmation page, that cookie consent blocks measurement or that a blocker stops the tag from loading.
Why does GA4 show more purchases than I have orders?
Almost always because of duplicates: two systems sending the same purchase, the confirmation page being reloaded or purchases sent without a transaction ID.
Do I need Google Tag Manager for GA4 in PrestaShop?
No. Tag Manager is useful if you already manage several tags with it, but it needs a data layer from the shop. A module can send the events to GA4 directly.