How To Track The GA4 Purchase Event

The GA4 purchase event is a recommended ecommerce event that records a completed transaction on your website or app. You send it when a user finishes a purchase, typically on an order confirmation page or after a payment button click.

This article walks through the prerequisites, the parameters you need to include, how to send the event via Google Tag Manager, how to avoid duplicate transactions, and where to find purchase data in your reports.

What The Purchase Event Needs

To send the purchase event, you need a Google Analytics account with a web data stream and the Google tag installed on your site. You also need access to the website source code and at least the Editor role in GA4. If you haven't added the Google tag yet, see the guide to adding GA4 to your website and find your Measurement ID.

The event should fire on the page where a purchase is confirmed. You can trigger it when the page loads (by placing the gtag code directly in a <script> tag at the end of the <body>) or when a user clicks a "Purchase" button. The official tutorial from Google shows both methods. Before going live, enable debug mode to verify that the event and its parameters reach GA4 correctly. Add 'debug_mode': true to your gtag('config', 'TAG_ID') call, then open the DebugView report. Every time you trigger the purchase event, it appears there in real time.

Click path: Admin then Data display then DebugViewAdminData displayDebugView
DebugView displays the purchase event with all its parameters in real time.

The purchase event must include an items array, where each item has at least item_id or item_name. The array can hold up to 200 items, and you can add up to 27 custom parameters in the items array on top of the prescribed ones. The array represents the products or services sold, and GA4 uses it to populate item-scoped dimensions like Item name, Item brand, and Item category. Whether you add the code directly or use Google Tag Manager, the event name must be exactly purchase (all lowercase), and the structure must follow the expected format so that GA4 can map parameters to its predefined dimensions and metrics.

The purchase event accepts several event-level parameters and an items array with item-level parameters. The table below lists the key parameters you should include, based on the official purchase event reference.

ParameterTypeRequiredDescription
transaction_idstringRequiredA unique ID for the transaction. Used for deduplication.
valuenumberRequired*Total revenue, sum of (price * quantity) for all items. Do not include shipping or tax.
currencystringRequired*3-letter ISO 4217 code (e.g., USD). Required if value is set.
taxnumberOptionalTotal tax amount.
shippingnumberOptionalTotal shipping cost.
couponstringOptionalOrder-level coupon code.
itemsArray<Item>RequiredAn array of one or more items purchased.

Each object in the items array supports its own set of parameters. At a minimum, you must provide item_id or item_name (both is recommended). Other useful fields include price, quantity, item_brand, item_category through item_category5, item_variant, discount, and coupon. If you omit quantity, it defaults to 1. You can also add up to 27 custom parameters in the items array. The full list of supported item parameters is in the GA4 ecommerce events reference.

Setting currency at the event level is important: it becomes the primary currency for standard reporting. If you send value without a currency, revenue metrics may not compute accurately. Also, make sure the value you pass matches the sum of (price * quantity) for all items, as Google's reference asks. Revenue metrics are built from value, while Item revenue comes from item price and quantity, so a mismatch shows up as two numbers that disagree. Note that item-level coupon and discount are independent of the event-level coupon; you can apply a discount to the whole order and also mark individual items with their own coupon codes or discount amounts.

Short on time? Analytics Art can check this in your property for you.

Sending Purchase With Tag Manager

If you manage your tracking with Google Tag Manager, you can send the purchase event through a GA4 Event tag. This approach lets you control when and how the event fires without editing your site's HTML directly. The steps below assume you already have the Google tag (which replaced the GA4 Configuration tag) deployed on every page. If not, follow the GA4 and GTM setup guide first.

  1. In Google Tag Manager, click Tags > New.
  2. Click Tag Configuration and choose Google Analytics: GA4 Event.
  3. In the Measurement ID field, enter your G- ID (or a Constant variable that holds it). Older containers showed a Configuration Tag dropdown here instead.
  4. In the Event Name field, type purchase.
  5. Under Event Parameters, click Add Row for each event-level parameter you want to send. For example, add a row with parameter name transaction_id and its value, another for value, and so on. The value can be a constant, a variable, or a data layer value.
  6. For the items parameter, you typically need to pass an array variable. You can create a Data Layer Variable that reads an ecommerce.items key, or use a Custom JavaScript variable to build the array from other data points. The data layer article explains how to structure this.
  7. Click Triggering and define when the tag should fire. A common choice is a Page View trigger that fires only on the order confirmation page, or a Custom Event trigger if you push a data layer event like purchase_complete.
  8. Save the tag, then click Submit and Publish to push the changes live.

Make sure the data layer is populated with the purchase information before the tag fires. For example, your order confirmation page should push the transaction details to the data layer above the GTM container snippet. You can verify the data layer content using the GTM preview mode, and then check DebugView in GA4 to confirm the event arrives with all parameters.

Avoiding Duplicate Transactions

GA4 uses the transaction_id parameter to deduplicate purchase events. When you send two events with the same transaction ID, Analytics counts only one transaction. This is important because a user might refresh the order confirmation page or revisit it later, causing the purchase tag to fire again. Without a unique and stable transaction ID, your reports would show inflated purchase counts and revenue.

To avoid duplicates, generate a unique transaction_id for each completed order on your server and pass it to the data layer or directly into the gtag call. The ID should remain the same for that order across all related events. For example, if you later send a refund event, you must use the same transaction ID so GA4 can tie the refund to the original purchase. The official setup tutorial demonstrates this by assigning a different transaction ID (T_12345_2) in its button-click example to distinguish it from the page-load example, explicitly noting that this prevents deduplication between the two test scenarios.

If you omit transaction_id, Analytics has no ID to deduplicate on, so accidental repeat fires can inflate your purchase counts. For production sites, always include a transaction ID and make sure it is generated once per order and stored reliably (for example, in a server-side session or database) so that the same value is used even if the page is reloaded. In Google Tag Manager, you can pull the ID from a Data Layer Variable that is populated by your order confirmation page before the tag fires.

Checking Purchases In Reports

After you send the purchase event, the data becomes available in GA4 reports, explorations, and the API within about 24 hours. For immediate verification, use DebugView as described earlier. To see aggregated purchase data, open the Ecommerce purchases report. This prebuilt report shows item-level data, such as Item revenue by Item name. The Monetization overview report also surfaces ecommerce data automatically.

Click path: Reports then Monetization then Ecommerce purchasesReportsMonetizationEcommerce purchases
The Ecommerce purchases report shows revenue and transaction data.

The table below shows how some of the parameters you send with the purchase event map to GA4 dimensions and metrics. This mapping is automatic; you don't need to create custom definitions.

ParameterDimension / Metric
affiliationItem affiliation
currencyCurrency
discountItem discount amount
indexItem list position
item_brandItem brand
item_categoryItem category
item_idItem ID
item_list_idItem list ID
item_list_nameItem list name
item_nameItem name
item_variantItem variant
location_idItem location ID
shippingShipping amount
taxTax amount
transaction_idTransaction ID

In addition to these dimensions, GA4 calculates metrics automatically. For a single purchase event with a value of 30.03, you would see Item revenue = 30.03, Total revenue = 30.03, and Ecommerce purchases = 1. You can also access raw purchase data via BigQuery Export or the GA4 Data API for custom analysis.

Frequently Asked Questions

What Is The GA4 Purchase Event?

The purchase event is a recommended ecommerce event that records a completed transaction in Google Analytics 4. It sends details such as transaction ID, revenue, tax, shipping, and the items purchased. GA4 uses this event to populate the Ecommerce purchases report and to calculate metrics like total revenue.

How Do I Set Up The GA4 Purchase Event?

You can set it up by adding the gtag.js purchase code to your order confirmation page or by creating a GA4 Event tag in Google Tag Manager. The event must include an items array with at least item_id or item_name, and a unique transaction_id. After implementation, verify the event in DebugView to confirm that the parameters are correct.

What Parameters Are Required For The GA4 Purchase Event?

The items array is required; each item must have item_id or item_name. For accurate revenue reporting, value and currency are required if you set value. The transaction_id is also required in Google's reference, and it lets Analytics deduplicate repeat fires. Other parameters like tax, shipping, and coupon are optional but useful.

Why Is My GA4 Purchase Event Not Working?

Common causes include a missing or incorrect Measurement ID, the Google tag not loading before the event fires, missing required parameters like items, or duplicate transaction IDs causing deduplication. Use DebugView to confirm whether the event reaches GA4 and inspect its parameters. Also check that your tag is not blocked by consent settings.

What Is The Purchase Revenue Metric In GA4?

Purchase revenue is the revenue from purchase events, built from the value parameter you send. Set value to the sum of (price * quantity) for all items, excluding shipping and tax. Purchase revenue is one part of Total revenue in the Monetization reports.

How Do I Track Purchases On Shopify With GA4?

Google notes that on Shopify some ecommerce events are tracked automatically through the Shopify Pixel. Follow Shopify's own setup instructions for the details, and avoid running a second setup that also sends purchase, or each order may be counted twice. Keep transaction IDs unique.