Explicitly prepare missing stored GA4 datasets
/sites/{site_id}/ga4/store/prepareanalytics:read, analytics:prepareAsk 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.
| Request | POST https://satelliteai.io/api/v1/sites/{site_id}/ga4/store/prepare |
| Permission | analytics:read, analytics:prepare |
| Response | A single object: data is Ga4PreparationData. |
| Operation ID | prepareGa4StoredData |
More context and worked examples are in the developer guide.
Example request
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
| Name | In | Type | Description |
|---|---|---|---|
site_idrequired | path | integer | Authorized site id. Parent and site grants must also match. min 1 · max 9223372036854775807 |
windowrequired | query | string | Property-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 |
datasets | query | string | Comma-separated 1–8 canonical names from getGa4Datasets with supports_public_prepare=true. Default site_totals. default site_totals · max length 1000 |
confirmrequired | query | boolean | Must 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.
| Field | Type | Description |
|---|---|---|
data.site_id | integernullable | Site id. |
data.report_set_id | integernullable | Report set id. |
data.source | stringnullable | Source. |
data.start | stringnullable | Start. |
data.end | stringnullable | End. |
data.timezone | stringnullable | Timezone. |
data.status | string | one of: pending, ready, unsupported, empty_period |
data.missing_datasets | array of string | |
data.unsupported_datasets | array of string | |
data.collection | object | Present when collection work is queued or attempted. |
data.collection.state | string | queued or failed. |
data.collection.jobs | array of object | |
data.collection.jobs[].job_id | string | Use the site GA4 jobs endpoint to poll this job. |
data.collection.jobs[].status | string | Collection job state. |
Response metadata
| Field | Type | Description |
|---|---|---|
meta.request_id | stringalways present | Request identifier; also returned in X-Request-ID. Include it in support requests. |
meta.api_version | stringalways present | API version that produced the response. one of: v1 |
meta.limit | integer | Maximum records per page applied to this request. min 1 · max 100 |
meta.has_more | boolean | True when another page is available. |
meta.next_cursor | stringnullable | Opaque cursor for the next page; send as cursor. Null on the last page. |
meta.availability | string | available when stored data exists; not_available when it does not. one of: available, not_available |
meta.billing | object | Present for paid live SERP requests; replayed receipts describe the original debit, not an additional charge. |
meta.billing.operation | stringalways present | one of: client_api_serp_refresh |
meta.billing.credits_charged | integeralways present | min 0 |
meta.billing.transaction_id | integeralways present | |
meta.billing.replayed | booleanalways present |
Error responses
Errors return {"error": {"code", "message", "request_id"}}. See error handling for retry guidance.
| HTTP | When |
|---|---|
400 | Invalid parameters |
401 | Invalid credentials |
403 | Missing permission |
404 | Missing or inaccessible resource |