Cohorts
const url = 'https://digize.com/api/v1/analytics/cohorts?by=visit';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/analytics/cohorts?by=visit' \ --header 'x-api-key: <x-api-key>'Twelve weekly cohorts: by visit, visitors grouped by the week of their first visit to the sites, with how many came back and bought in each week after; by order, customers grouped by the week of their first order, with how many ordered again in each week after and what it came to. Use it for “do people come back?” and “do customers buy again?”.
Needs the analytics:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”First visit or first order.
First visit or first order.
By visit only: one site’s visitors.
By visit only: one site’s visitors.
Responses
Section titled “Responses”Done
object
Twelve weekly cohorts, oldest first.
object
The week the cohort started in, Monday.
object
Weeks after the cohort’s first, from 0.
Of the cohort, visitors who came back (by visit) or customers who ordered (by order) that week.
Visits that week (by visit).
Purchases (by visit) or orders (by order) that week.
Orders less refunds in minor units (by order).
Example
{ "by": "visit", "unavailable": { "reason": "token" }}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" }}