GTag-GA
A small ES module that sends Google Analytics 4 page views and events straight from Node.js. One import, one configuration call, and no dependencies.
About this project
GTag-GA sends Google Analytics 4 page views and events through the official gtag.js interface, packaged as a Node.js ES module. One import and one call with a measurement ID, and tracking is live.
The API is the gtag API rather than a vocabulary of its own: the initialising call takes the measurement ID and an optional configuration object, and the event call takes the same arguments the official documentation shows, so anything written about gtag.js applies directly here.
The package has zero dependencies, ships TypeScript declarations, follows current Google Analytics 4 behaviour and runs anywhere an ES module does. It is a few kilobytes for the one job of getting a page view or an event to Google Analytics without a tag manager in between.
Features
TypeScript types
No dependencies
