Skip to content

v0.1.0

Choose a tag to compare

@rustyconover rustyconover released this 14 Nov 16:19
· 9 commits to main since this release

First release of vgi-google-analytics: Google Analytics 4 reports, realtime data and property configuration as ordinary DuckDB tables, via a read-only VGI worker (Python). The worker only requests the analytics.readonly scope and allows GET plus three read RPCs (runReport, runRealtimeReport, checkCompatibility).

Surface

  • Tables: account_summaries, accounts, properties
  • Reports: report() (typed columns, string =/IN filter pushdown), realtime_report(), check_compatibility(), property_quota()
  • Metadata / configuration: dimensions(), metrics(), data_streams(), custom_dimensions(), custom_metrics(), key_events()
  • Pass '' as the property to cover every readable property; WHERE property_id = ... / IN narrows it.
  • Credentials: a google_analytics DuckDB secret (service account, OAuth refresh-token grant, or access token), browser sign-in with credentials 'oauth', or ADC on stdio.

Composed examples

The catalog examples include queries that combine functions:

  • report() joined to properties: revenue and revenue per session, in each property's currency
  • report() event breakdown joined to key_events(): how often each key event fired per property
  • data_streams() joined to account_summaries: the account and property behind each web measurement id

Install

Requires Haybarn 2.0.0rc11 or newer (VGI 3 extension).

ATTACH 'ga4' (TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-google-analytics@v0.1.0 vgi-google-analytics');
CREATE SECRET ga (TYPE google_analytics, service_account_json '<key file contents>');

Source-only release; not published to PyPI.

Known limits

  • Every call needs Google credentials; there is no anonymous access.
  • Not exposed: pivot, batch, cohort, funnel and access reports; audience exports and change history (they need write or edit scopes); Universal Analytics.
  • The property argument must be a literal (DuckDB does not accept subqueries as table-function arguments); use '' for all properties.

See CHANGELOG.md for the full list.