GA4 Ecommerce Tracking Setup: Events, Revenue, and Attribution
GA4 ecommerce tracking isn’t optional anymore. If you’re running an online store and still relying on Universal Analytics patterns—or worse, no tracking at all—you’re flying blind with your marketing budget. And that’s a terrible place to be.
Let me be blunt. The default GA4 setup captures almost nothing useful for ecommerce. You get page views. You get sessions. Cool. But do you know which products people actually view, add to cart, or buy? Not without custom event implementation. Google gives you a recommended ecommerce event schema, and if you don’t follow it, your revenue reports will sit there empty, mocking you.

The Event Model You Actually Need
GA4 runs on events. Every interaction is an event now—no more hit types like pageviews, transactions, and events living in separate buckets. That shift sounds simple but it changes everything about how you architect tracking.
For ecommerce, Google recommends a specific sequence of events that map to the purchase funnel. The recommended events reference spells out the exact event names and parameters. Here’s the lineup:
view_item_list— someone browses a category page or search resultsselect_item— they click on a specific productview_item— the product detail page loadsadd_to_cart— obviousbegin_checkout— they start the checkout flowadd_shipping_info— shipping details enteredadd_payment_info— payment method selectedpurchase— money changes hands
That’s your funnel. Miss any of these events and you’ve got gaps in your data that’ll make analysis frustrating—or misleading.
Here’s the thing. You don’t have to implement every single one on day one. But view_item, add_to_cart, and purchase are your non‑negotiables. Without those three, you can’t calculate conversion rates, you can’t see revenue in your reports, and you can’t build useful audiences for remarketing. Everything else is gravy that makes your analysis richer.

Getting the Data Layer Right
So what does this actually mean in practice? It means your developers need to push structured data into a dataLayer object that Google Tag Manager—or gtag.js—can read and forward to GA4.
Let’s say you sell specialty coffee beans online. A hypothetical product detail page for “Ethiopian Yirgacheffe 12oz” needs to fire a view_item event with an items array containing the product’s ID, name, category, price, and any other relevant attributes from the GA4 ecommerce spec. Something like this:
dataLayer.push({
event: "view_item",
ecommerce: {
currency: "USD",
value: 18.99,
items: [{
item_id: "ETH-YIRG-12",
item_name: "Ethiopian Yirgacheffe 12oz",
item_category: "Single Origin",
price: 18.99,
quantity: 1
}]
}
});
That items array is everything. GA4 ecommerce reports won’t populate without it. I’ve seen stores fire purchase events with the revenue value but skip the items array entirely—and then wonder why their product performance reports show zero data.
And a quick gotcha that trips people up constantly. You need to push an ecommerce: null clear before each new ecommerce event to prevent stale data from bleeding between pushes. Skip this and you’ll get phantom products appearing in transactions they don’t belong to. Ugly stuff.

Revenue: Where the Money Shows Up
The purchase event is where GA4 calculates your revenue. You pass value, currency, transaction_id, and the full items array. Without transaction_id, you risk duplicate transactions inflating your numbers—especially if someone refreshes the confirmation page. Google calls this out in the ecommerce purchases documentation.
Let’s go back to our coffee store. A hypothetical order where someone buys two bags of Ethiopian Yirgacheffe and one bag of Colombian Supremo would look like a purchase event with a value of $52.97, a unique transaction ID, and an items array containing both products with their respective quantities and prices.
But wait—should value include tax and shipping? Google’s documentation says the value parameter should reflect total revenue, and you can pass tax and shipping as separate parameters. My strong recommendation: be consistent. Pick a convention, document it, and stick with it across every purchase event. Inconsistency here will make your CFO question every revenue report you produce.
One thing that catches people off guard. Revenue data in GA4 can take 24–48 hours to fully process and appear in the monetization reports. Don’t panic if you push a test purchase and see nothing immediately. Check DebugView first—real‑time reports second—and standard reports last.

Attribution: The Part Everyone Argues About
GA4’s attribution model is different from what you’re used to. Gone are the days of last‑click‑gets‑all‑credit as the default. GA4 uses data‑driven attribution as its primary model, which distributes conversion credit across multiple touchpoints using Google’s machine learning. That’s covered in the GA4 ecommerce documentation.
So what does this actually mean for your ecommerce store?
Imagine a hypothetical customer named Sarah. She first discovers your coffee store through an Instagram ad on Monday. Doesn’t buy. Wednesday she googles “best Ethiopian coffee beans” and clicks your organic result. Still doesn’t buy. Friday she clicks a retargeting ad on Facebook and finally purchases. Under last‑click attribution, Facebook gets 100% of the credit. Under data‑driven attribution, GA4 distributes credit across all three touchpoints based on how much each interaction actually influenced the conversion.
This matters enormously for budget allocation. If you’re only looking at last‑click, you might slash your Instagram spend because it “never converts.” But it’s doing the heavy lifting at the top of the funnel—introducing people to your brand who later convert through other channels.
You can change your attribution model in GA4 under Admin > Attribution Settings. Options include last‑click (both cross‑channel and ads‑preferred) and data‑driven. I’d leave it on data‑driven unless you have a specific reason not to. It’s the most honest picture of what’s working.
One frustration worth mentioning. GA4’s attribution only works with the conversion events you’ve marked. If you haven’t gone into your admin settings and toggled purchase as a conversion event—or key event, as Google recently renamed them—attribution modeling won’t apply to it. A five‑second configuration step that’s easy to forget.

Debugging Without Losing Your Mind
Testing ecommerce events is tedious. No way around it.
Your best tools are GA4’s DebugView—which shows events in near‑real‑time as they fire from devices with debug mode enabled—and Google Tag Manager’s Preview mode. Use them together. GTM Preview confirms the dataLayer push looks correct. DebugView confirms GA4 actually received and processed the event with the right parameters.
Here’s a workflow that saves time. Enable GTM Preview, walk through a complete purchase flow on your staging site, and check every single event in both tools before pushing anything to production. Tedious? Yes. Worth it? Absolutely—because finding a broken purchase event three weeks after launch means three weeks of lost revenue data you can never recover.
Watch for these common mistakes: currency codes in lowercase when they should be uppercase (“usd” vs “USD”), price passed as a string instead of a number, missing transaction_id on purchase events, and items arrays that are empty or malformed.

The Reporting Payoff
Once everything’s wired up correctly, GA4’s monetization reports come alive. You’ll see purchase revenue by source/medium. Product performance by item name and category. Funnel visualization from view_item through purchase with drop‑off rates at each step.
That coffee store hypothetical? You might discover that 68% of people who add Ethiopian Yirgacheffe to their cart actually complete the purchase—but Colombian Supremo has a 23% cart‑to‑purchase rate. Now you’re asking the right questions. Is it the price? The product page? Shipping costs that appear at checkout?
That’s the real power here. Not just knowing your total revenue—any payment processor tells you that—but understanding why revenue is rising or falling and which parts of your funnel are leaking.
If you want help validating your GA4 ecommerce setup, Truelogic’s digital marketing team can audit the event flow, clean up the data layer, and make sure you’re tracking revenue the way your business actually measures it. We also pair these insights with conversion improvements through our conversion rate optimization services.
For deeper context, you might also like our guide to digital marketing trends, our breakdown of top digital marketing platforms, and our internet marketing tips article.




