Setting Up GA4 and Google Ads Conversion Tracking Correctly for E-Commerce

Mehmet Akar 3 min read
GA4 e-commerce conversion tracking diagram

When GA4 e-commerce tracking is set up incorrectly, ad budgets end up being managed based on flawed data. Here is the event structure and checklist I use to prevent double counting, missing purchases, and attribution issues.

Common Mistakes

  • Firing the purchase event on both order confirmation and the thank-you page.
  • Page refreshes being counted twice because transaction_id is not sent.
  • Importing both the GA4 conversion and the Google Ads tag conversion as primary in Google Ads.
  • Inconsistent decisions about tax and shipping in the value field, causing discrepancies across reports.

The common outcome of these mistakes is that the ad platform bids based on conversions that never actually happened. Smart bidding strategies learn even worse habits when fed bad data.

Proper Setup

The purchase event should be sent only once, when the order is finalized. Every order must have a unique transaction_id; GA4 can deduplicate repeat purchase events that arrive with the same ID.

dataLayer/purchase.json
{
  "event": "purchase",
  "ecommerce": {
    "transaction_id": "SIP-10482",
    "value": 1249.90,
    "currency": "TRY",
    "items": [{ "item_id": "P-221", "quantity": 1 }]
  }
}
  • Set a single rule for value (e.g., tax included, shipping excluded) and apply it consistently everywhere.
  • In Google Ads, choose only one primary purchase conversion and set the other as secondary.
  • If you use consent mode, test that your tags behave properly according to the user's consent status.

Whenever possible, trigger the event server-side after receiving confirmation from the payment provider. Browser-side events may never fire if the user closes the page right after payment, resulting in missing purchases in your reports.

Here are the core events and required parameters in GA4 e-commerce tracking:

EventWhen is it sent?Key parameters
view_itemWhen a product page is vieweditems, value, currency
add_to_cartWhen a product is added to the cartitems, value, currency
begin_checkoutWhen checkout startsitems, value, currency
purchaseOnce, when the order is finalizedtransaction_id, value, currency, items
refundWhen a refund is approvedtransaction_id, value, currency

Verification

Place a test order and verify in GA4 DebugView and Google Ads tag diagnostics that events fire only once and carry the right values. Then compare the number of purchases in GA4 with the order count in your store dashboard over a full week; a small variance is normal, while a large gap points to a setup error.

NOTE

Make a note of the week you fix your tracking; that date is essential when interpreting changes in ad performance.

Tracking is the first step of an e-commerce audit; check out the 90-day roadmap note for the full sequence. You can also see how I set up tracking on my own sites in the StepperSkip project.

Setting up add_to_cart and begin_checkout alongside purchase shows you where users drop off. Sending refunds with the refund event keeps revenue reports closer to reality. Make sure to use the same item IDs and currency across all of these events.

Tracking refunds keeps revenue reports accurate. For a full refund, transaction_id alone is enough; for a partial refund, include the returned products inside items.

dataLayer
{
  "event": "refund",
  "ecommerce": {
    "transaction_id": "SIP-10482",
    "value": 1249.90,
    "currency": "TRY"
  }
}

Pre-Launch Testing Checklist

  1. Place a test order and confirm that the purchase event appears only once in DebugView.
  2. Refresh the thank-you page and verify that no duplicate purchase is recorded.
  3. Check in Google Ads that the conversion is recorded as a single primary action.
  4. Repeat the same flow after rejecting cookie consent and verify that tags respect the consent state.
  5. Compare order counts between GA4 and your store dashboard after one week.

Conclusion

Accurate GA4 e-commerce tracking ensures your ad decisions rely on solid data. To review your ad and tracking setup together, visit the e-commerce consulting page.

More notes

All notes →