Repository navigation
v0.1.0
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=/INfilter 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 = .../INnarrows it. - Credentials: a
google_analyticsDuckDB secret (service account, OAuth refresh-token grant, or access token), browser sign-in withcredentials 'oauth', or ADC on stdio.
Composed examples
The catalog examples include queries that combine functions:
report()joined toproperties: revenue and revenue per session, in each property's currencyreport()event breakdown joined tokey_events(): how often each key event fired per propertydata_streams()joined toaccount_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.