Google Analytics
Get Google Analytics Report
Read your site's measured sessions, users, signups and other key events, and revenue from Google Analytics 4, by landing page, source, channel, AI assistant, country, device or date, and compare two periods.
Endpoint
Parameters
| Name | Type | Required | Note |
|---|---|---|---|
| identifieraccount · required | account | required | — |
| propertyIdstring · required | string | required | Pick a GA4 property, or type its ID (digits). |
| rangestring · optional | string | optional | A period ending yesterday on the property's clock. Ignored when a start and end date are given. One of: Default: |
| startDatestring · optional | string | optional | First day, written YYYY-MM-DD. Give it together with End date. Example: |
| endDatestring · optional | string | optional | Last day, written YYYY-MM-DD, included. Example: |
| dimensionsarray · optional | array | optional | What each row is. Several give one row per combination. Leave empty for one row of totals. One of: |
| metricsarray · optional | array | optional | What to count. Default sessions, users and key events. One of: |
| keyEventstring · optional | string | optional | Count one key event only, by its name. List Google Analytics Key Events names them. Example: |
| trafficFromstring · optional | string | optional | Keep only sessions from AI assistants (ChatGPT, Perplexity, Gemini, Copilot, Claude and others), or from organic search. One of: Default: |
| filtersrepeating-group · optional | repeating-group | optional | Conditions a row must all pass, for example Landing page contains /blog/. |
| compareTostring · optional | string | optional | Also read an earlier period and return the change for each row and the totals. Cannot be combined with Group by Date. One of: Default: |
| sortBystring · optional | string | optional | A metric, or a metric followed by _change when two periods are compared (sessions_change). Default: the first metric, highest first; with a comparison, its largest change either way first. Example: |
| sortDirectionstring · optional | string | optional | For a change, ascending puts the biggest drops first and descending the biggest gains. One of: |
| limitnumber · optional | number | optional | Most rows to return, 1 to 1000. Default 50. Default: |
| offsetnumber · optional | number | optional | Rows to skip, to read the next page. |
Response schema
{
"type": "object",
"properties": {
"rows": {
"type": "array",
"description": "Each row: its dimension values by name (with aiAssistant beside a sessionSource that is an assistant), then each metric. With a comparison also previous<Metric> and <metric>Change"
},
"notes": {
"type": "array",
"description": "Limits of this answer worth repeating to the reader"
},
"source": {
"type": "string",
"description": "Always Google Analytics"
},
"totals": {
"type": "object",
"description": "Each metric's total over every row, not only those returned"
},
"endDate": {
"type": "string",
"description": "Last day covered, YYYY-MM-DD"
},
"hasMore": {
"type": "boolean",
"description": "True when more rows follow; read on with nextOffset"
},
"metrics": {
"type": "array"
},
"measured": {
"type": "boolean",
"description": "True: what the site recorded, not an estimate"
},
"rowCount": {
"type": "number"
},
"timeZone": {
"type": "string",
"description": "The property's time zone, which its dates use"
},
"startDate": {
"type": "string",
"description": "First day covered, YYYY-MM-DD"
},
"totalRows": {
"type": "number"
},
"dimensions": {
"type": "array"
},
"nextOffset": {
"type": "number"
},
"propertyId": {
"type": "string"
},
"trafficFrom": {
"type": "string"
},
"comparedWith": {
"type": "object",
"description": "The earlier period (startDate, endDate), when two periods were compared"
},
"currencyCode": {
"type": "string",
"description": "Revenue currency, when revenue is reported"
},
"previousTotals": {
"type": "object",
"description": "The same totals for the earlier period, when compared"
}
}
}