npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentapps/app.google.analytics

v3.1.0

Published

Run GA4 reports, query realtime data, and manage properties and data streams

Readme

Google Analytics

Lets an agent work with Google Analytics 4 (GA4): run reports and realtime reports, read the dimensions and metrics a property offers, and manage properties and data streams. It calls the Google Analytics Data API (v1beta) for reports and the Google Analytics Admin API (v1beta) for accounts, properties and streams, through the googleapis client, with the OAuth token of the connected Google account.

Limits:

  • GA4 only. Universal Analytics properties are not supported.
  • batch-run-reports runs at most 5 reports per call. run-realtime-report covers the last 30 minutes.
  • delete-property moves a property to the trash; Google keeps it there for a limited time, after which it is gone.
  • Google applies quotas per property to the Data API; pass returnPropertyQuota: true to run-report to see what is left.

Tools

| Tool | What it does | Writes? | |---|---|---| | list-accounts | Lists the GA4 accounts the user can reach. | no | | list-properties | Lists the properties of an account. | no | | get-property | Returns one property's details. | no | | list-data-streams | Lists a property's web, iOS and Android data streams. | no | | get-data-stream | Returns one data stream. | no | | get-metadata | Lists the dimensions and metrics a property offers, custom ones included. | no | | run-report | Runs a report with metrics, dimensions, date ranges, filters and ordering. | no | | batch-run-reports | Runs up to 5 reports on one property in one call. | no | | run-realtime-report | Runs a report on the last 30 minutes of activity. | no | | create-property | Creates a GA4 property under an account. | yes, asks first | | update-property | Changes a property's name, time zone, currency or industry category. | yes, asks first | | delete-property | Moves a property to the trash. | yes, asks first | | create-data-stream | Creates a web, iOS or Android data stream under a property. | yes, asks first |

Setup

In a Google Cloud project, enable the Google Analytics Data API and the Google Analytics Admin API. Create an OAuth client of type Web application (https://console.cloud.google.com/apis/credentials) with the redirect URI the Station uses, {station URL}/auth/callback, and add these scopes to the consent screen: https://www.googleapis.com/auth/analytics.readonly, https://www.googleapis.com/auth/analytics.edit and https://www.googleapis.com/auth/userinfo.email.

agentapps install app.google.analytics analytics
agentapps config app.google.analytics CLIENT_ID:<client id> CLIENT_SECRET:<client secret>
agentapps analytics auth
agentapps analytics tools
agentapps analytics tool list-accounts pageSize:10

CLIENT_ID and CLIENT_SECRET are system secrets: one OAuth client for every installation of the app. agentapps analytics auth signs one installation in and stores its tokens. The tools can see and change what the connected Google user can in Google Analytics.

Terms of use

Google's own terms apply to everything the app does on your behalf: the Google APIs Terms of Service at https://developers.google.com/terms and the Google Analytics Terms of Service at https://marketingplatform.google.com/about/analytics/terms/us/. The Data API's quotas are described at https://developers.google.com/analytics/devguides/reporting/data/v1/quotas.

Logos

TODO: record the official source of assets/logo.svg and assets/logo-mono.svg (Google's brand resources or its own site). They have been in the repository since before this README existed and their origin was not written down.