Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 purchase only tracked after PayPal or 3DS return: fix

TRK-098High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

With card payments on your own checkout, the customer lands on a thank-you page straight after paying. With PayPal, and with banks that ask for 3D Secure (an extra identity check, often a code in a banking app), the customer leaves your site, pays elsewhere, and is then sent back to a return URL.

If your only purchase tracking is a browser tag on that return page, the sale is recorded only if the customer actually comes back. The payment can succeed and the order can exist in your shop, while GA4 shows nothing.

Where the purchase goes missing
  1. CheckoutCustomer picks PayPal or pays by card with 3DS
  2. PayPal / bank pagePayment is approved
  3. Return to your siteCustomer closes the tab or the redirect fails
  4. Thank-you page tagpurchase event never fires
  5. GA4 and ad platformsSale never reported

The customer pays on PayPal or the bank page, but never returns to your site, so the browser tag never runs.

Why it costs you leads or sales

You do not lose the order, but you lose the proof of where it came from. GA4 revenue falls below your shop's revenue, and Google Ads, Meta and other platforms see fewer conversions than really happened. Smart bidding learns from the conversions it sees, so it can under-value the campaigns that bring PayPal buyers.

The gap also skews reports. PayPal-heavy audiences, such as mobile shoppers, can look worse than they are, and you may cut budget from channels that are working.

Orders in the shop vs purchases in GA4Example numbers
Orders in the shop vs purchases in GA4 (example)Orders in shop: 100 orders; Purchases in GA4: 92 orders; Missing: 8 orders03877100928Orders in shopPurchases in GA4Missingorders

Example: 100 orders in the shop, of which 30 were paid via PayPal or 3DS and 8 of those buyers never returned. GA4 sees 92.

How to check if your site has it

Compare your shop with GA4
  1. Pick a period and count orders

    Export paid orders from your shop for the last 7 to 30 days, with the payment method for each.

  2. Count GA4 purchases

    In GA4 go to Reports > Monetization > Ecommerce purchases, or use Explore with transaction_id as a dimension. Export the transaction IDs.

  3. Find the orders missing from GA4

    Match both lists on order ID. If the missing ones are mostly PayPal, Klarna-style redirects or 3DS payments, you have this issue.

  4. Run a test order

    Pay with PayPal sandbox or a 3DS test card, then close the tab on the PayPal page before returning. Check GA4 DebugView and the order. If the order exists but no purchase appears, the tag depends on the return.

How to fix it

There are two layers. First, make the return as reliable as possible. Second, stop depending on the return by sending the purchase from your server when the payment is confirmed.

Fix the redirect dependency
  1. Turn on automatic return

    In PayPal, enable Auto Return (Account Settings > Website payments) and set the return URL to your thank-you page. This sends buyers back without clicking.

  2. Make the return URL carry the order

    Make sure the return page can look up the order (order ID or token in the URL) so the purchase event has a real transaction_id and value.

  3. Send the purchase from the server

    When your shop gets the payment confirmation (webhook), send a purchase event to GA4 with the Measurement Protocol, using the same client_id as the visitor's browser session.

  4. Deduplicate with transaction_id

    Send the same transaction_id from the browser and the server. GA4 counts one purchase per transaction_id, so a buyer who does return is not double counted.

  5. Store the client_id with the order

    Read the GA4 client ID from the _ga cookie at checkout and save it on the order, so the server event can be attributed to the right session.

Platform specifics
  1. Use WooCommerce's payment webhook

    Fire your tracking on the order status change to processing or completed (hook woocommerce_payment_complete), not only on the thank-you page. Many GA4 plugins offer a server-side or Measurement Protocol option; check your plugin's settings.

  2. Enable PayPal Auto Return

    Set it in your PayPal account and check the return URL in the WooCommerce PayPal gateway settings.

Server-side purchase via the GA4 Measurement Protocol (Node.js 18+)javascript
// Run when your payment webhook confirms the payment
const MEASUREMENT_ID = 'G-XXXXXXXXXX';
const API_SECRET = 'your_api_secret';

async function sendPurchase(order) {
  const url = `https://www.google-analytics.com/mp/collect?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`;
  await fetch(url, {
    method: 'POST',
    body: JSON.stringify({
      client_id: order.ga_client_id, // saved at checkout from the _ga cookie
      events: [{
        name: 'purchase',
        params: {
          transaction_id: order.id,
          value: order.total,
          currency: order.currency,
          items: order.items.map(i => ({ item_id: i.sku, item_name: i.name, price: i.price, quantity: i.qty }))
        }
      }]
    })
  });
}
Purchase tracking before and after

Browser tag only

  • Purchase fires only on the return page
  • Buyers who close the tab are never tracked
  • GA4 revenue is below shop revenue

Browser plus server

  • Purchase sent when payment is confirmed
  • Same transaction_id prevents double counting
  • GA4 orders match the shop

How to confirm it's fixed

Confirmation checklist
  • Place a PayPal sandbox order and close the tab before returning: the purchase still appears in GA4 (Realtime or DebugView).
  • Place a 3DS test-card order and complete it normally: only one purchase appears for the transaction_id.
  • The server event shows the right value, currency and items.
  • After a week, shop orders and GA4 purchases match more closely, especially for PayPal orders.
  • Ad platform conversions for redirect payments no longer lag behind the shop.

How to prevent it happening again

Keep it from coming back
  • Compare shop orders and GA4 purchases by payment method each month.
  • Re-test PayPal and 3DS after changing payment plugins, checkout themes or return URLs.
  • Keep the same transaction_id format in browser and server events.
  • Document where the purchase is sent from, so an update does not remove one of the two sources.
  • Rotate the API secret only with a plan to update the server code.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. Its robot visitor runs your checkout journey on a schedule and checks each step and the tracking hits sent to GA4 and other platforms. By design it stops before payment unless your store's test mode is set up, and it never enters real card details.

What FunnelGuard covers for this issue
CheckCovered?
Checkout steps work up to the payment stepYes
Purchase tracking on a test order, if the store's test mode is set upYes, when test mode is configured
Real PayPal or 3DS payment and the return to your siteNo, it stops before payment
Buyers who pay and never returnNo
Comparison of shop orders with GA4 purchasesNo

To cover the rest by hand, run the monthly order-to-GA4 comparison from the check section and test a PayPal sandbox order where you close the tab before returning. FunnelGuard will still alert you if the checkout steps or tracking hits it can reach break. You can start with the Free plan (1 site, 2 journeys, daily checks, no card) or a 3-day trial of any paid plan.

Why it happens: a typical timeline

One PayPal order, step by step
  1. 0:00

    Buyer clicks the PayPal button at checkout.

  2. 0:30

    Buyer approves the payment on PayPal. The shop receives the confirmation and creates the order.

  3. 0:31

    Buyer closes the tab instead of returning.

  4. 0:32

    The thank-you page never loads, so no purchase is sent to GA4.

Questions people ask

Why is my GA4 purchase count lower than my real orders?

Common causes are ad blockers, consent choices and redirect payments. If the missing orders are mostly PayPal or 3D Secure, the purchase tag probably runs only on the page buyers return to, so anyone who does not return is not tracked.

Why is purchase not tracked when customers pay with PayPal?

PayPal takes the buyer off your site. Your purchase tag fires only when they come back to your thank-you page. If they close the tab or the redirect fails, the order exists but GA4 never receives the event.

How do I track PayPal purchases in GA4 reliably?

Turn on PayPal Auto Return, and send the purchase from your server with the GA4 Measurement Protocol when the payment is confirmed. Use the same transaction_id in browser and server events so GA4 does not count the sale twice.

Does 3D Secure break GA4 purchase tracking?

It can. 3DS sends the buyer to their bank for a check and then back to your site. If the return is slow, blocked or abandoned, a browser-only purchase tag does not run, even though the payment went through.

Will sending the purchase from the server double count sales?

Not if both events carry the same transaction_id. GA4 uses transaction_id to avoid counting the same purchase twice, so keep the browser tag and add the server event.

How do I attribute a server-side purchase to the right campaign?

Save the GA4 client ID from the _ga cookie on the order at checkout, then send it as client_id in the Measurement Protocol call. This ties the server event to the visitor's original session.

Can FunnelGuard test PayPal or 3DS purchases?

Only in part. FunnelGuard checks your checkout up to the payment step and stops there unless your store's test mode is set up. It does not complete real PayPal or 3DS payments, so you should also test a sandbox order by hand.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: stops before payment unless test mode.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.