{"library":"react-ga4","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"3.0.1","tags":["javascript","GA","GTM","Google Analytics","Google Analytics 4","Google Tag Manager","typescript"],"install":[{"cmd":"npm install react-ga4","imports":["import ReactGA from 'react-ga4';","import ReactGA from 'react-ga4';\nReactGA.initialize('G-MEASUREMENT_ID');","import ReactGA from 'react-ga4';\nReactGA.send({ hitType: 'pageview', page: '/my-custom-path', title: 'Custom Page Title' });","import ReactGA from 'react-ga4';\nReactGA.event({ category: 'Video', action: 'play', label: 'My Video', value: 100 });"]},{"cmd":"yarn add react-ga4","imports":[]},{"cmd":"pnpm add react-ga4","imports":[]}],"homepage":null,"github":"https://github.com/codler/react-ga4","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/react-ga4","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/react-ga4/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Mon Jul 20","install_tag":null}}