For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Google Analytics

Configuration reference for the Google Analytics 4 batch source: service-account setup, supported report resources, source/sink options, and sampling limits.

Google Analytics 4 is Google's web/app analytics platform. Nilus uses GA4 as a batch source to run Data API reports, built-in or custom, and load the results into a downstream warehouse.

Under the hood, Nilus authenticates against the GA4 Data API using a Google Cloud service account, scoped to one GA4 property ID supplied in the URI host.

Requirements

Connectivity and credentials must both be in place before the pipeline can run.

Connectivity

  • The Nilus runtime must be able to reach https://analyticsdata.googleapis.com over HTTPS.

  • Add the service-account email as a Viewer of the GA4 property (Admin → Property Access Management).

  • Pass the GA4 numeric property ID in the URI host (no properties/ prefix).

Service-account JSON keys are sensitive. Store via Nilus secrets/projections (or use credentials_base64 from a secret) rather than committing the JSON to YAML.

Required parameters

Parameter
Required
Default
Description

credentials_path

Yes

-

Path to the service-account JSON key file inside the runtime container.

credentials_base64

One of credentials_path or credentials_base64

-

Base64-encoded contents of the service-account JSON.

URI format

googleanalytics://<property-id>?credentials_path=<service-account-json-path>
googleanalytics://<property-id>?credentials_base64=<credentials-base64>

Supported reports

Report
Merge key
Strategy
Description

traffic

date

merge

Traffic-source breakdown by day.

events

date

merge

Event counts by day and event name.

ecommerce

date

merge

Ecommerce performance by day.

demographics

date

merge

Demographics breakdown by day.

custom:<dimensions>:<metrics>

configurable

merge

Custom GA4 report. Provide GA4 dimensions and metrics as comma-separated lists. Must include at least one date dimension (date, yearMonth).

Source options

Option
Required
Description

source_table

Yes

One of the resources in the supported reports table.

interval_start

No

Lower bound for resources that support a time window.

interval_end

No

Upper bound for resources that support a time window.

incremental_key

No

Not used. Nilus manages refresh cadence per resource internally.

Sink options

Option
Required
Description

dest_table

Yes

Destination table name. Use one stable target per source resource so re-runs merge cleanly.

incremental_strategy

Yes

Destination write behavior. Use merge for dated reports and replace for snapshot-style reports.

Sample Nilus config

Behavior and capabilities

  • Pipeline type: Google Analytics runs as a batch source.

  • Report selection: set source.options.source_table to a built-in report or a custom:<dimensions>:<metrics> report from the supported reports table.

  • Fetch semantics: report windows are controlled with interval_start and interval_end; use a date dimension for custom reports that need merge-friendly incremental windows.

  • Custom reports: dimensions and metrics must be valid GA4 API fields, and custom reports should include date or yearMonth for time-windowed loads.

  • API limits: GA4 applies property-level quotas and may sample high-cardinality reports. Shorten windows or reduce dimensions when reports become too large.

Troubleshooting

Symptom
Likely cause
Resolution

PERMISSION_DENIED

Service-account email is not a Viewer on the GA4 property.

Add it under Admin → Property Access Management → Add User.

SERVICE_DISABLED

GA Data API not enabled in the Cloud project.

Enable Google Analytics Data API in Cloud Console → APIs & Services.

Custom report fails

Dimensions/metrics not valid GA4 fields, or no time dimension.

Check the GA4 dimensions and metrics list and include date or yearMonth.

Sampled data warning

GA4 sampling on high-cardinality custom reports.

Reduce dimensions or shorten the window to stay below sampling thresholds.

Last updated

Was this helpful?