What is the code for this GA4 event?
Pick one of Google's recommended events and fill in its parameters. You get the gtag call and the Tag Manager dataLayer.push, both read back with the rules of the GA4 event name checker and the ecommerce dataLayer checker.
A GA4 measurement ID (G-...) or a Google Ads ID (AW-...), added to the gtag version as send_to. Leave it empty unless you need to name one destination.
What it writes
- Google's recommended events. All 35 events in Google's reference, in the groups Google uses: online sales, lead generation, events for all properties and games. Each event shows the parameters Google lists for it, with the required ones marked.
- Two versions of the same event. A gtag call for a site with the Google tag in its code, and a dataLayer.push for Google Tag Manager. Shop events go inside ecommerce, after a push that clears the previous ecommerce object, as in Google's Tag Manager examples. Other events carry their parameters next to the event name.
- Items from a table. One row per product, with item_id or item_name, price, quantity and the other common item fields. When value is empty and every item has a price, value is set to the sum of price × quantity, as Google says to set it.
- Checked the way the other tools check. The code is read back with the rules of the GA4 event name checker and, for shop events, the ecommerce dataLayer checker. What this page writes passes there.
- Values that cannot break the code. Numbers are written as numbers, yes or no as true or false, and text in quotes with every special character escaped, so nothing you type can end the string, the call or the script tag early.
The events and their parameters come from Google's recommended events reference, and the Tag Manager version follows Google's data layer guide, both read in November 2026.
What it does not do
It writes fixed values. On a real site the order number, the prices and the items change with every order, so put your site's own variables in place of the values before you publish the code.
It does not put the code on your site or send anything to Google. Check that the event arrives in GA4's DebugView or in Tag Manager's preview.
Custom parameters and the less common item fields (item_category2 to item_category5, item_list_id and item_list_name on an item, index, affiliation, location_id) are not in the form. Add them by hand, and paste the result into the ecommerce checker to read it again. Everything runs in your browser and nothing you type is sent anywhere.
Questions
gtag or Tag Manager?
Use the one your site already runs. If the Google tag is in the page code, use the gtag call. If you manage your tags in Google Tag Manager, use the dataLayer.push and let a GA4 event tag in Tag Manager send it.
Why was value filled in for me?
Google says to set value to the sum of price × quantity for all items. When value is empty and every item has a price, the page adds them up. Type your own value to replace it.
Do I need currency?
Yes, whenever you set value. Google's reference says currency is required if you set value, as a three-letter ISO 4217 code such as EUR.
Can I use my own event names?
This page writes Google's recommended events. Check the names of your own events with the GA4 event name checker.