UnQTools
SEO Runs in your browser

GA4 Event Builder

Build Google Analytics 4 event tracking code. Generate gtag.js event calls, GTM dataLayer pushes, and Measurement Protocol payloads. Presets for page_view, scroll, click, form_start, form_submit, purchase. 100% client-side.

100% Private Works Offline Instant

About GA4 Event Builder

Build Google Analytics 4 event tracking code. Generate gtag.js event calls, GTM dataLayer pushes, and Measurement Protocol payloads. Presets for page_view, scroll, click, form_start, form_submit, purchase. 100% client-side. Everything runs locally in your browser — your data never leaves your device.

How to use

  1. Enter your input in the tool above.
  2. Adjust any options to your preference.
  3. Use the Copy or Download buttons to save the result.
  4. Everything happens locally — your data never leaves your browser.

FAQ

What is a GA4 event?

In Google Analytics 4, every interaction is an event — page views, scrolls, clicks, form submissions, purchases. Events have a name (e.g. 'purchase') and up to 25 parameters (e.g. value, currency, items). You collect events via gtag.js, Google Tag Manager, or the Measurement Protocol.

gtag.js vs GTM dataLayer vs Measurement Protocol — when to use which?

gtag.js is the direct GA4 snippet — call gtag('event', ...) from your site's JavaScript. GTM dataLayer is for sites using Google Tag Manager — push events to dataLayer and GTM forwards them. Measurement Protocol is for server-side tracking (offline conversions, POS systems, IoT) — POST events to Google's endpoint.

What naming rules apply to GA4 events and parameters?

Event names: must start with a letter, contain only letters/numbers/underscores, max 40 characters. Parameter names: same rules, max 40 characters. Reserved event names (page_view, scroll, click, etc.) trigger automatic collection — use them only if you're manually sending those events.

How many parameters can an event have?

Up to 25 parameters per event (was 100 in early GA4, reduced). Custom parameters must be registered in the GA4 admin (Configure → Custom definitions) to appear in reports. Event-scoped custom dimensions are recommended for any parameter you want to filter or report on.

What extra features does this tool have compared to others?

(1) Event name presets (page_view, scroll, click, form_start, form_submit, purchase). (2) Custom parameters (key-value pairs). (3) gtag.js code generation. (4) GTM dataLayer push code generation. (5) Measurement Protocol JSON payload. (6) Event + param name validation (length, characters). (7) Copy each code snippet. (8) Stats — param count. (9) History (localStorage, last 20). (10) Shareable URL — encode form in fragment.

Is my data sent anywhere?

No. All code generation is pure string manipulation. We don't send events to Google. History is stored in localStorage on this device only.

Search tools and actions

Search across all 218 tools, categories, and quick actions.