CLIENT API / V1 GOOGLE ANALYTICS 4

Explicitly prepare missing stored GA4 datasets

POST/sites/{site_id}/ga4/store/prepareanalytics:read, analytics:prepare

Ask the user before calling. Explicitly queue missing stored GA4 datasets for a granted site, with confirm=true. datasets is one to eight comma-separated names from get_ga4_datasets. Requests are deduplicated by the store; collection uses the manual analysis queue and Google quota. Does not spend Satellite credits, change schedules, or start other analyses. Poll the returned job/coverage rather than repeatedly preparing. The documented form sends query parameters on an empty-body POST. JSON is also accepted by the API, but do not mix it with query parameters. Work is deduplicated on analysis_queue and does not change schedules or charge Satellite credits. Poll GET /sites/{site_id}/ga4/jobs/{job_id}, then reread the report; do not poll by repeatedly preparing.

RequestPOST https://satelliteai.io/api/v1/sites/{site_id}/ga4/store/prepare
Permissionanalytics:read, analytics:prepare
ResponseA single object: data is Ga4PreparationData.
Operation IDprepareGa4StoredData

More context and worked examples are in the developer guide.

Example request

cURL · Bash
curl --fail-with-body --request POST \
  'https://satelliteai.io/api/v1/sites/123/ga4/store/prepare?window=previous_month&confirm=true' \
  -H "Authorization: Bearer $SATELLITE_API_KEY"

Replace the example IDs with values returned by the discovery endpoints. Example values are placeholders, not real records.

Parameters

NameInTypeDescription
site_idrequiredpathintegerAuthorized site id. Parent and site grants must also match.
min 1 · max 9223372036854775807
windowrequiredquerystringProperty-local completed dates: 1d–366d, current_month/mtd, previous_month, previous_quarter, ytd, or YYYY-MM-DD/YYYY-MM-DD (at most 366 days).
example previous_month
datasetsquerystringComma-separated 1–8 canonical names from getGa4Datasets with supports_public_prepare=true. Default site_totals.
default site_totals · max length 1000
confirmrequiredquerybooleanMust be true. Explicit confirmation to queue manual GA4 collection; requires analytics:prepare in addition to analytics:read.
one of: True · example True

Unknown or repeated query parameters return 400.

Data dictionary

Ready, unsupported or empty-period preparation result. Inspect data.status. Explicit manual preparation. Equivalent work is deduplicated; schedules are unchanged. Fields can be absent depending on status.

202: Stored collection is queued; read coverage or the returned job status.

[] marks an array element. nullable means the value can be null; treat it as unknown, not zero. always present means the key is always included in the object.

Fields in data
FieldTypeDescription
data.site_idintegernullableSite id.
data.report_set_idintegernullableReport set id.
data.sourcestringnullableSource.
data.startstringnullableStart.
data.endstringnullableEnd.
data.timezonestringnullableTimezone.
data.statusstring
one of: pending, ready, unsupported, empty_period
data.missing_datasetsarray of string
data.unsupported_datasetsarray of string
data.collectionobjectPresent when collection work is queued or attempted.
data.collection.statestringqueued or failed.
data.collection.jobsarray of object
data.collection.jobs[].job_idstringUse the site GA4 jobs endpoint to poll this job.
data.collection.jobs[].statusstringCollection job state.

Response metadata

Fields in meta
FieldTypeDescription
meta.request_idstringalways presentRequest identifier; also returned in X-Request-ID. Include it in support requests.
meta.api_versionstringalways presentAPI version that produced the response.
one of: v1
meta.limitintegerMaximum records per page applied to this request.
min 1 · max 100
meta.has_morebooleanTrue when another page is available.
meta.next_cursorstringnullableOpaque cursor for the next page; send as cursor. Null on the last page.
meta.availabilitystringavailable when stored data exists; not_available when it does not.
one of: available, not_available
meta.billingobjectPresent for paid live SERP requests; replayed receipts describe the original debit, not an additional charge.
meta.billing.operationstringalways present
one of: client_api_serp_refresh
meta.billing.credits_chargedintegeralways present
min 0
meta.billing.transaction_idintegeralways present
meta.billing.replayedbooleanalways present

Error responses

Errors return {"error": {"code", "message", "request_id"}}. See error handling for retry guidance.

HTTPWhen
400Invalid parameters
401Invalid credentials
403Missing permission
404Missing or inaccessible resource