Explore Google Analytics
const url = 'https://digize.com/api/v1/google-analytics/explore?metrics=sessions&startDate=28daysAgo&endDate=yesterday&compare=previousPeriod&orderBy=sessions&order=desc&limit=100';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://digize.com/api/v1/google-analytics/explore?metrics=sessions&startDate=28daysAgo&endDate=yesterday&compare=previousPeriod&orderBy=sessions&order=desc&limit=100' \ --header 'x-api-key: <x-api-key>'A GA4 report built to order: up to 10 metrics broken down by up to 9 dimensions, over any days GA4 has (28daysAgo to yesterday unless asked), against another range if asked, filtered by dimension values, sorted and cut to a limit. For what googleAnalytics.report doesn’t answer, such as landing pages by device, a campaign’s purchases, or a page’s engagement against the month before.
Needs the analytics:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”GA4’s metric names. Rates (engagementRate, bounceRate, sessionKeyEventRate) are 0 to 1, durations seconds, revenue in the property’s currency; keyEvents are what GA4 used to call conversions; the item metrics count products and go with itemName.
GA4’s metric names. Rates (engagementRate, bounceRate, sessionKeyEventRate) are 0 to 1, durations seconds, revenue in the property’s currency; keyEvents are what GA4 used to call conversions; the item metrics count products and go with itemName.
GA4’s dimension names to break the numbers down by: landingPage is a visit’s first page, pagePath any page viewed, sessionDefaultChannelGroup its channel (Organic Search, Paid Search, Direct…), deviceCategory desktop, mobile or tablet, date a day as 20261030.
GA4’s dimension names to break the numbers down by: landingPage is a visit’s first page, pagePath any page viewed, sessionDefaultChannelGroup its channel (Organic Search, Paid Search, Direct…), deviceCategory desktop, mobile or tablet, date a day as 20261030.
The first day: a date such as 2026-10-01, or today, yesterday or NdaysAgo, on the property’s clock.
The first day: a date such as 2026-10-01, or today, yesterday or NdaysAgo, on the property’s clock.
The last day.
The last day.
Compare with the same many days just before, or the same days 52 weeks earlier so weekdays line up.
Compare with the same many days just before, or the same days 52 weeks earlier so weekdays line up.
Or name the comparison’s first day…
Or name the comparison’s first day…
…and its last.
…and its last.
Only rows matching every one, ignoring case: “deviceCategory is mobile”, “landingPage contains /shop”, “sessionDefaultChannelGroup in Organic Search|Paid Search”. Any allowed dimension, in the report or not.
Only rows matching every one, ignoring case: “deviceCategory is mobile”, “landingPage contains /shop”, “sessionDefaultChannelGroup in Organic Search|Paid Search”. Any allowed dimension, in the report or not.
One of the report’s own metrics or dimensions. Left out, the first time dimension in order, or else the first metric, the biggest first.
One of the report’s own metrics or dimensions. Left out, the first time dimension in order, or else the first metric, the biggest first.
Responses
Section titled “Responses”Done
object
object
The property’s clock, which its days are on.
Each metric over every row, people counted once.
object
Whether GA4 had more rows than the limit let through.
Whether Google left rows out so nobody can be singled out.
Example generated
{ "property": { "property": "example", "name": "example", "currency": "example", "timeZone": "example" }, "startDate": "example", "endDate": "example", "compare": { "startDate": "example", "endDate": "example" }, "dimensions": [ "example" ], "metrics": [ "example" ], "rows": [ { "dimensions": { "additionalProperty": "example" }, "metrics": { "additionalProperty": 1 }, "previous": { "additionalProperty": 1 } } ], "totals": { "additionalProperty": 1 }, "previousTotals": { "additionalProperty": 1 }, "more": true, "thresholded": true}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}