measurementProtocol - an R library for sending server-side data to Google Analytics 4

CRAN CloudBuild codecov

The Measurement Protocol v2 is for sending data to Google Analytics 4.

This library enables the ability to use the API from R.

It also includes functions to use the measurement protocol to track events such as R library loads for package usage analytics.

Complement the package with googleAnalyticsR to read the data you send.


Install from CRAN


Dev version from GitHub:



See the documentation on the measurementProtocol website:

You need a Google Analytics 4 account to send the hits to.