@robinpath/google-analytics
v0.3.0
Published
Google Analytics (GA4) integration — run reports, pivot reports, realtime reports, batch reports, and query traffic / conversions / active users. Service-account authentication using a JWT exchange (no user OAuth dance). GA4 only — no legacy Universal Ana
Downloads
144
Readme
@robinpath/google-analytics
Google Analytics module for RobinPath.
Why use this module?
The google-analytics module lets you:
- runReport
- runRealtimeReport
- batchRunReports
- runPivotReport
- getMetadata
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
robinpath add @robinpath/google-analyticsQuick Start
1. Set up credentials
google-analytics.setCredentials "your-credentials"2. runReport
google-analytics.runReportAvailable Functions
| Function | Description |
|----------|-------------|
| google-analytics.setCredentials | Configure google-analytics credentials. |
| google-analytics.runReport | runReport |
| google-analytics.runRealtimeReport | runRealtimeReport |
| google-analytics.batchRunReports | batchRunReports |
| google-analytics.runPivotReport | runPivotReport |
| google-analytics.getMetadata | getMetadata |
| google-analytics.listProperties | listProperties |
| google-analytics.getProperty | getProperty |
| google-analytics.listAccounts | listAccounts |
| google-analytics.getActiveUsers | getActiveUsers |
| google-analytics.getPageViews | getPageViews |
| google-analytics.getTopPages | getTopPages |
| google-analytics.getTrafficSources | getTrafficSources |
| google-analytics.getUserDemographics | getUserDemographics |
| google-analytics.getConversions | getConversions |
Examples
runReport
google-analytics.runReportrunRealtimeReport
google-analytics.runRealtimeReportbatchRunReports
google-analytics.batchRunReportsIntegration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/google-analytics";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
google-analytics.setCredentials "your-credentials"
google-analytics.runReport
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/google-sheets— Google Sheets module for complementary functionality@robinpath/google-calendar— Google Calendar module for complementary functionality@robinpath/google-contacts— Google Contacts module for complementary functionality@robinpath/google-forms— Google Forms module for complementary functionality@robinpath/gmail— Gmail module for complementary functionality
License
MIT
