Code Snippet Library / Analytics

GA4 Event Parameter Schema Validator

The GA4 Event Parameter Schema Validator is a free code snippet that catches GA4 events and parameters that Google will silently truncate or drop before they ever hit your property, based on GA4's own documented limits, live-verified against Google's current support docs.

↗ View on GitHub ⬇ Download Full Repo (.zip)
MIT
License
JSON
Language
Aug 17, 2026
Last updated
README.md View raw ↗

What this is (and isn’t)

Pure functions you call against your own event payloads before sending them, not a hosted service or a GA4 API integration. Runs entirely in your own environment.

Files

FilePurpose
ga4-validator.jsvalidateEventName(), validateParameterName(), validateParameterValue(), validateEvent() — zero dependencies
test.js24-test suite covering every documented limit, including the page_title/page_referrer/page_location value-length exceptions

The limits, live-verified against Google’s own docs

Fetched directly from Google’s current support pages: event name 40 characters max, parameter name 40 characters max, parameter value 100 characters max with documented exceptions (page_title 300, page_referrer 420, page_location 1000), max 25 parameters per event, and reserved prefixes that cannot be used for custom names (underscore, firebase_, ga_, google_, gtag.). Google can update these over time, so the limits are exported constants, not buried magic numbers.

FAQ

Is this free to use?

Yes. Free to download and use. MV3 charges $175/hr only if you want help wiring this into your real event-tracking pipeline.

Does this call the GA4 API?

No. It is a pure function you run against your own event payloads before sending them, entirely in your own environment.

Where do these limits come from?

Fetched directly from Google's current official support documentation, not assumed from memory. Sources are linked in the README.

What if Google changes these limits?

GA4_LIMITS and RESERVED_PREFIXES are exported constants, not hardcoded deep in the logic, so you can override them if the documented values change.

RB
Ryan Brooks
Technical SEO, MV3 Marketing