To make GA4 in OpenCart show not only visits but also sales, you need to send e-commerce events: product view, add to cart, start of checkout, and purchase with the order total and contents. The OpenCart core does not do this in either 3.0 or 4.1, so the events are added with a module or through Google Tag ManagerA container for managing scripts without editing code. More in the glossary →. Below are the events you need, where to get their data in OpenCart, and how to make sure the data is correct.
What does e-commerce give you in GA4, and why isn't the tag enough?
A regular Google AnalyticsA system for analyzing visitor behavior. It is connected with code or in "Extensions → Extensions," type "Analytics." More in the glossary → tag on the pages counts sessions, traffic sources, and page views. That is enough to know how many people came from Instagram or search, but not enough to answer the main question for a store: which sources bring orders and money. For that, GA4 has a separate set of "Monetization" reports, which are filled only when the site sends e-commerce events.
When events are configured, you see revenue by each channel and campaign, best-selling products, the funnel from product view to purchase, average order valueRevenue divided by the number of orders. More in the glossary →, and the share of returning customers. The same data is imported into Google Ads as conversions with value, so ads start optimizing for sales rather than clicks. For what to set up before GA4, see the article store analytics on the first day.
Pay attention to the difference between OpenCart versions.
- OpenCart 3.0: there is a standard Google Analytics extension ("Extensions → Extensions", type "Analytics"). It simply outputs the code you insert into the header of every page and knows nothing about products or orders.
- OpenCart 4.1: the "Analytics" extension type exists, but a ready-made Google Analytics extension is not included.
So in both versions, the standard tools only give you a basic tag, and e-commerce has to be added separately.

Which e-commerce events does an OpenCart store need?
GA4 has standard event names for e-commerce. Use exactly these, not invented names: then reports and the import into Google Ads will work without additional setup.
| GA4 event | Where it occurs in OpenCart | Priority |
|---|---|---|
purchase | Successful order confirmation page | Required |
add_to_cart | "Buy" button on the product card and in lists | Required |
begin_checkout | Transition to the checkout page | Required |
view_item | Product page | Recommended |
view_item_list | Category, search, product modules on the home page | Recommended |
view_cart, remove_from_cart | Shopping cart | Recommended |
add_shipping_info, add_payment_info | Choosing shipping and payment at checkout | As needed |
Every event with products passes the items array: product identifier (SKU or product_id), name, price, quantity, and ideally the manufacturer and category. For a purchase, you also need the order number transaction_id, the total value, and the currency currency — for a Ukrainian store that is UAH. The order number is mandatory: GA4 uses it to reject a repeated event with the same number.
Decide in advance what counts as the product identifier. If you plan to advertise through Google Merchant CenterA Google service where the product feed for Shopping ads is uploaded. It requires correct prices, availability, and identifiers. More in the glossary →, the identifier in the events must match the identifier in the product feed, otherwise remarketing for specific products will not find matches.
Where in OpenCart do you get the data for events?
The hardest part of e-commerce for OpenCart is not the tag code, but the correct data at the right moment. There are several peculiarities of the core that you need to account for.
Adding to cart works through AJAX
The "Buy" button does not reload the page: in OpenCart 3.0 it calls the checkout/cart/add route, in OpenCart 4.1 the checkout/cart.add route. Therefore add_to_cart must be sent from JavaScript after a successful server response, not on click: if the product was not added (a required option was not selected, out of stock), the event must not be sent.
The success page clears order data
On the successful order page (route checkout/success), OpenCart in both 3.0 and 4.1 removes the order number and checkout data from the session. The default template of this page does not receive the order number, total, or products. The analytics module must save the order data earlier or insert it into the page before it is cleared — this is exactly where homemade solutions most often break.
Online payment can bypass the success page
A customer paying by card goes to the payment service page and does not always return to the site. Then the purchase event on the success page will not fire, even though the order has been paid. The solution is to send the purchase from the server via the GA4 Measurement Protocol at the moment the order receives its status, or at least to compare the number of purchases in GA4 and in the admin panel. If the status does not change after payment either, see the article payment went through, but the status did not change.
A module or Google Tag Manager?
There are two working ways to add e-commerce to OpenCart. The first is a ready-made module that generates events itself from OpenCart data. The second is Google Tag Manager: the site puts product and order data into the dataLayer data layer, and the GA4, Google Ads, and pixel tags are configured in the GTM interface. However, someone still has to write the data layer in OpenCart templates, so GTM does not eliminate the developer's work; it only moves tag settings from code to the interface.
Here is what a purchase event looks like in the data layer, so you know what should appear on the success page:
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: '1052',
value: 2450.00,
currency: 'UAH',
shipping: 80.00,
items: [
{ item_id: 'SKU-118', item_name: 'Чайник електричний', price: 1185.00, quantity: 2 }
]
}
});
For OpenCart 3.0, a complete ready-made solution is the SP SEO Remarketing All In One Pro module: it sends enhanced e-commerce to GA4 and, in parallel, events for Google Ads, Meta Pixel with Conversions API, TikTok, and other systems, so you don't have to stitch several scripts together. How it is configured is described in detail in the review GA4, Facebook CAPI and TikTok in OpenCart. For OpenCart 4.1, choose a module whose 4.1 compatibility is explicitly stated in the description, or GTM with a data layer.
Also think about cookie consent: if the banner simply blocks GA4 until consent is given, some purchases will disappear from the reports. How to do this correctly will be covered in the Consent Mode section article.
How do you check that GA4 counts correctly?
Run the check right after setup and after every update of the theme or checkout modules: those are the most common causes of broken events.
- Enable debug mode in GA4 (DebugView) or the Tag Assistant extension, and go through the buyer's path: category → product → cart → checkout → purchase.
- Make sure each event arrives once and has a products array with price and quantity.
- Place test orders with each payment and shipping methodAn extension that calculates the cost: "Extensions → Extensions," type "Shipping." More in the glossary →, including online payment and returning from the bank's website.
- Check the total: whether shipping is included in
value, and whether the coupon is accounted for. The main thing is one consistent rule for all orders. - Refresh the success page: a repeated purchase should not appear.
- After a week, compare the number of purchases and the revenue in GA4 with the sales report under "Reports → Reports" in the admin panel.

A small discrepancy (roughly up to 10–15%) is normal due to ad blockers and cookie refusals, and depends on your audience. However, if GA4 shows twice as many or twice as few purchases as the admin panel, look for duplicates or lost online payments. Delete the test orders afterward or mark them with a separate status so they don't distort the reports.
If you want to see traffic, GA4 revenue, and advertising directly on the OpenCart 3.0 admin dashboard, there is the Store Analytics Dashboard widget. It does not replace event setup; it only shows their results.
Summary
- The standard GA4 tag counts visits, and sales appear only with e-commerce events.
- OpenCart 3.0 has a basic Google Analytics extension only for inserting code; OpenCart 4.1 does not have one. E-commerce in both versions requires a module or GTM with a data layer.
- Minimum set:
purchasewith the order number, total, currency UAH, and products;add_to_cartafter a successful AJAX response;begin_checkout. - Keep in mind that the success page clears order data, and online payment may bypass it entirely.
- One source of events, test orders for each payment method, and regular reconciliation with the admin panel.
Other advertising and analytics settings — pixels, remarketing, UTM — are collected in the section Advertising and Analytics.