Repository navigation
Releases
v0.2.1
Container image for Orchard hosting: ghcr.io/query-farm/vgi-google-analytics:0.2.1 (multi-arch, cosign-signed), serving HTTP on $PORT by default or stdio with stdio. Published by .github/workflows/docker-publish.yml on each vX.Y.Z tag (:edge from main). Speaks VGI protocol 3.4 (vgi-python 0.55); Orchard hosted mode (VGI_ORCHARD_HOSTED=1) built in. Credentials come only from DuckDB secrets.
v0.2.0
Speaks VGI protocol 3.4 (vgi-python >=0.55.1,<0.56), so it needs Haybarn 2.0.1 or newer (or stock DuckDB 2.0 with INSTALL vgi FROM query_farm). Haybarn 2.0.0 loads a 3.3 vgi extension that cannot attach it. See CHANGELOG/README for details.
Full Changelog: v0.1.3...v0.2.0
v0.1.3
v0.1.2
- Bump vgi-python to 0.52.2.
Full Changelog: v0.1.1...v0.1.2
v0.1.1
Changed
- Docs link to upstream: the catalog documentation now links the GA4 Data API,
its dimensions-and-metrics schema and quotas, the Admin API, and Application
Default Credentials (vgi-lint VGI183).
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.