Skip to content

Guide

OpenCart GA4 Server-Side Tracking: Get the Purchases GA4 Misses

  • opencart ga4
  • opencart google analytics 4
  • opencart ga4 server-side
  • measurement protocol
  • ga4 purchase tracking
  • server-side tracking

GA4 can only report what it receives. On an OpenCart store the GA4 tag runs in the buyer’s browser and reports the purchase from the checkout success page, so every buyer who blocks the tag or never reaches that page is a sale GA4 never sees. Your conversion rate looks low, your channel reports undercount and the revenue in GA4 does not match the revenue in your admin.

This guide explains why, and how to send OpenCart purchases to GA4 from your server.

Why GA4 misses OpenCart purchases

  • The tag is blocked. Ad blockers and privacy browsers stop gtag.js and Google Tag Manager before they load. No tag, no purchase.
  • The success page never loads. A buyer who pays on the payment provider’s page and closes the tab never reaches checkout/success, where the purchase event fires.
  • Consent holds the tag. With a cookie banner, the tag waits until the visitor accepts. Visitors who never click are invisible.
  • Refunds never arrive. A refund in OpenCart does not reach GA4 unless something sends GA4’s refund event, so revenue in GA4 stays higher than yours.

The answer is the GA4 Measurement Protocol: Google’s server-to-server API for GA4. An event sent through it does not depend on the browser at all.

What a good server-side GA4 setup for OpenCart does

  1. Sends the purchase when OpenCart records the sale, not when a page loads.
  2. Joins the purchase to the visit. The server event carries the client id from the _ga cookie and the session id of the GA4 session, so GA4 reports the purchase with the visit your tag recorded, not as a stray one.
  3. Never counts an order twice. The order number goes out as transaction_id. GA4 keeps one purchase per transaction id, so the tag and the server never add up to two.
  4. Sends refunds as GA4’s refund event with the same transaction id, so revenue in GA4 falls when yours does.

How the AxiTrace extension does it

The free AxiTrace extension for OpenCart (OpenCart 3.0.3.x to 3.0.5.x and 4.0.2.x to 4.1.x) records each order on your server and AxiTrace sends it to your GA4 property through the Measurement Protocol:

  • An order is sent once, the first time it reaches a status your store counts as processing or complete (read live from your settings, Pending optional), or when a cash on delivery order is placed.
  • Value, tax, shipping and products go with the purchase, under GA4’s recommended event names. No Tag Manager, no server container and no tag to write.
  • A buyer whose browser blocked the GA4 tag has no _ga cookie. The purchase is still sent, under a client id AxiTrace builds, so GA4 counts the revenue even without a visit to put it on.
  • With the consent gate on, an event from a visitor who refused is not sent to GA4.

Next to a running GA4 tag, purchases and refunds are the recommended set: GA4 deduplicates purchases only, so page views and carts stay with your tag. More detail: GA4 server-side tracking.

Set it up

  1. Create a free account at axitrace.com/register and copy your workspace public key.
  2. Upload the package for your OpenCart version (axitrace.ocmod.zip) under Extensions, Installer, install AxiTrace under Extensions, Extensions, Analytics, paste the key and save.
  3. In AxiTrace, connect GA4 with two values from GA4 Admin, under Data Streams: the Measurement ID that starts with G- and a Measurement Protocol API secret you create there. Test connection checks them with GA4.
  4. Place a test order and look for it in GA4 DebugView or the Realtime report. Full steps: OpenCart setup guide.

If server events do not show up, our guide to GA4 server-side events not showing covers the usual causes.

GA4 is one of nine destinations

The same OpenCart order goes to the Meta Conversions API, Google Ads, TikTok, Pinterest, Reddit, LinkedIn, Microsoft Ads and OpenAI Ads, each through its own server API. And AxiTrace shows what GA4 does not: true ROAS per campaign from your real orders, with profit and POAS after product costs and refunds.

The extension is free and open source (GPL). The Free plan covers 10,000 visits a month, no credit card.

See server-side tracking for OpenCart

Written by

Chris Gaudy

Founder & CEO

Building accurate conversion tracking for e-commerce teams.

Get tracking insights in your inbox

Tips on server-side tracking, conversion optimization, and product updates. Delivered weekly.

No spam. Unsubscribe anytime.