Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

GA4 Event Code Generator — gtag, dataLayer and Measurement Protocol

Pick a recommended GA4 event — generate_lead, sign_up, purchase, add_to_cart and more — or name your own, fill in the parameters and items, and copy the code as gtag(), a Tag Manager dataLayer.push() or a server-side Measurement Protocol request. Names and values are checked against GA4’s limits as you type.

Aktualisiert am

Items

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: GA4 Event Code Generator

  1. Pick a recommended event to get its standard parameters, or choose Custom event and type a name like newsletter_signup.
  2. Fill in or add parameters; ecommerce events also get an Items list with add and remove buttons.
  3. Choose the format: gtag() for sites with the Google tag, dataLayer for Tag Manager, or Measurement Protocol for server-side events.
  4. Optionally wrap it in a click or form-submit listener, copy it, and check the event in GA4 DebugView.

Recommended events vs custom events

GA4 understands recommended events — such as generate_lead, sign_up, login, search and the ecommerce set from view_item to purchase — and fills its built-in reports with them. Use them whenever one fits. For anything else, a custom event works the same way; register its parameters as custom dimensions in Admin → Custom definitions to see them in reports.

The checks it runs

  • Event and parameter names: start with a letter, only letters, numbers and underscores, at most 40 characters, and no reserved prefixes (google_, ga_, firebase_) or reserved event names.
  • At most 25 parameters per event, and parameter values up to 100 characters.
  • Ecommerce: value needs a currency, purchase needs a unique transaction_id, and each item needs an item_id or item_name.

Three ways to send it

gtag() sends straight to GA4. With Tag Manager, dataLayer.push() hands the event to the container, where a Custom Event trigger and a GA4 event tag forward it — ecommerce pushes are preceded by { ecommerce: null } so old items don’t leak into the next event. The Measurement Protocol sends events from your server, for things that happen off the page, like a renewed subscription or an offline sale. To track clicks without writing code per button, use the Event Tracking Script Generator.

Auch gesucht als: ga4 event generator, gtag event code, ga4 event code, ga4 custom event, ga4 recommended events, ga4 ecommerce code, gtag purchase event, ga4 generate_lead.

Passende Tools zu: GA4 Event Code Generator

  • Google Tag Snippet Generator — Enter your GA4 measurement ID, Google Ads ID or Tag Manager container ID and get install code that is ready to paste — with Consent Mode v2 defaults, cross-domain linking, debug mode, manual page views and cookie settings switched on only when you need them.
  • dataLayer Push Generator — Build dataLayer.push() code for Google Tag Manager: choose a GA4 recommended event or your own, add parameters and ecommerce items, and optionally wrap it in a click or form submit listener — ready to paste.
  • GA4 Request Decoder — Debug Google Analytics 4 without guesswork.
  • UTM Builder — Add utm_source, utm_medium, utm_campaign and friends to any link, see which GA4 channel the visit will land in, and tag a whole list of URLs at once.

Häufige Fragen

How do I send a custom event to GA4?
Call gtag('event', 'your_event_name', { param: 'value' }) after the Google tag has loaded. Choose Custom event here, type the name and parameters, and copy the code.
Why don’t my event parameters show in reports?
Custom parameters only appear in standard reports after you register them in Admin → Custom definitions. Data from before registration is not filled in.
What is the difference between gtag and dataLayer.push?
gtag() is a small wrapper that pushes to the dataLayer for the Google tag. With Tag Manager you push plain objects with an event key, and triggers in the container decide what happens.
Do Measurement Protocol events need a client ID?
Yes. Use the client_id from the visitor’s _ga cookie to join server events to their web session, or your own stable ID for events with no web visit.
Kann ich GA4 Event Code Generator als Web-App installieren und offline nutzen?
Ja. GA4 Event Code Generator ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools