Purchase Event Builder
Build a complete GA4 purchase event with line items
How It Works
Enter transaction details
Add transaction ID, currency, total value, tax, and shipping amounts.
Add line items
Add each product with ID, name, category, price, and quantity.
Copy the generated code
Get the complete dataLayer.push() event code ready for implementation.
GA4 Purchase Event Builder
Items
Why the GA4 Purchase Event Requires Careful Implementation
The GA4 purchase event is the most important event in any ecommerce analytics implementation. It feeds revenue data into GA4 reports, conversion values into Google Ads for ROAS bidding, and audience qualification signals for remarketing. A correctly structured purchase event is the difference between having actionable ecommerce intelligence and having a dashboard full of misleading numbers.
The Complete GA4 Purchase Event Structure
- transaction_id (string) — Unique identifier for this order. Always use your order ID as a string, never as a number.
- value (number) — Total revenue for this transaction. Define clearly whether this includes or excludes tax and shipping.
- currency (string) — ISO 4217 three-letter currency code (USD, EUR, GBP).
- items array — Contains one object per product purchased, each with item_id, item_name, price, and quantity.
Purchase Event via GTM: Implementation Guide
The recommended pattern: push the ecommerce data to the data layer on the order confirmation page before the GTM snippet fires, then configure a GA4 Event tag in GTM triggered by a Custom Event trigger set to your purchase event name. In the GA4 Event tag, add a single parameter named ecommerce with value set to a Data Layer Variable reading from the key ecommerce.