Skip to main content

Google Analytics 4 Event Builder

Select a GA4 recommended event or build a custom event. Add parameters, validate against GA4 schemas, and copy ready-to-use gtag() or dataLayer.push() code.

✓ GA4 recommended & custom events ✓ gtag() and dataLayer.push() output ✓ Parameter validation

Frequently Asked Questions

What is a GA4 event and how is it different from Universal Analytics?▼

In GA4, everything is an event — pageviews, button clicks, purchases, scrolls. Unlike Universal Analytics which used categories/actions/labels, GA4 uses a flexible key-value parameter model. Each event has a name and up to 25 custom parameters. This makes GA4 much more flexible but requires more intentional event design.

What is the difference between gtag() and dataLayer.push()?▼

gtag() is the direct Google Analytics SDK method — call it directly on pages where you load the GA4 tag. dataLayer.push() is for Google Tag Manager (GTM) — you push events to the dataLayer and GTM picks them up and forwards to GA4. Use dataLayer if you manage tracking via GTM; use gtag() for direct GA4 implementation.

What are recommended events in GA4?▼

GA4 has a set of recommended events with predefined schemas — like purchase, add_to_cart, begin_checkout, sign_up, login, search, view_item, generate_lead. Using these enables automatic integration with Google Ads, BigQuery exports, and built-in GA4 reports. Always prefer recommended events over custom events when the semantic fits.

What parameters can I send with a GA4 event?▼

Each event can have up to 25 custom parameters. GA4 automatically collects some parameters (page_location, page_title, session_id, etc.). Custom parameters must be registered as 'custom dimensions' or 'custom metrics' in the GA4 property settings before they appear in reports. String values max 100 chars, numeric values as numbers.

How do I validate my GA4 implementation?▼

Use Google Analytics Debugview (in GA4 admin → DebugView), the GA4 Tag Assistant Chrome extension, or send events in debug mode by adding &_dbg=1 to your gtag.js URL. Also check the Network tab in DevTools for requests to google-analytics.com/g/collect to verify event payloads are being sent.

What is the currency parameter and how should I format it?▼

The currency parameter uses ISO 4217 currency codes (USD, EUR, GBP, JPY, etc.). The value parameter should be a numeric amount — do not include currency symbols. For example: gtag('event', 'purchase', { currency: 'USD', value: 29.99, transaction_id: 'T_12345' }). This is required for revenue tracking in GA4.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →