Preparing for system design interviews?  Try bugzed.com →

React Google Analytics 4 Wrapper

JSON →
library 3.0.1 ·javascript
verified Jun 17, 2026

React Google Analytics 4 (react-ga4) is a JavaScript library designed to integrate Google Analytics 4 (GA4) tracking into React applications. It provides a straightforward API for initializing GA4 with a measurement ID, sending page views, and tracking custom events. The current stable version is 3.0.1, which introduced significant breaking changes, migrating the library to an ESM-only module with first-class TypeScript support and Vitest for testing. Compared to its predecessor, `react-ga` (which focused on Universal Analytics), `react-ga4` is specifically built for the GA4 data model, removing legacy Universal Analytics (UA) features and streamlining event tracking. It offers a simple migration path from `react-ga` by replacing the import and removing explicit `pageview` calls, as page views are sent by default since v2.0.0. The library focuses on providing a thin, modern wrapper around the gtag.js API for React environments.

total hits 14
actors 4 distinct systems
last hit 20d ago AhrefsBot
GPTBot
4
Amazonbot
4
Script
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · VN · 🇩🇪 Germany