Campaigns
const url = 'https://digize.com/api/v1/analytics/campaigns?days=30&by=source&by=medium&by=campaign';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/campaigns?days=30&by=source&by=medium&by=campaign' \ --header 'x-api-key: <x-api-key>'Visits by UTM tagging over the last days, grouped by the fields asked for (source, medium and campaign unless by says otherwise; term and content too): sessions, visitors, bounce rate, pages per session, leads, bookings, purchases, conversion rate, revenue, refunds and net value per session. Sessions with none of the grouped tags are a row of their own (untagged). Use it for “which campaign brings buyers?”.
Needs the analytics:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”How many days back from now to read: 90 at most.
How many days back from now to read: 90 at most.
The UTM fields to group by.
The UTM fields to group by.
One site, by its Worker id; every site when left out.
One site, by its Worker id; every site when left out.
Responses
Section titled “Responses”Done
object
object
The sessions with none of the grouped UTM values.
Distinct visitors in the group; totals add the groups’ up, so a visitor in two counts twice.
Sessions that sent a form, booked or bought.
Purchases, in minor units.
Revenue less refunds, in minor units.
object
Distinct visitors in the group; totals add the groups’ up, so a visitor in two counts twice.
Sessions that sent a form, booked or bought.
Purchases, in minor units.
Revenue less refunds, in minor units.
object
Distinct visitors in the group; totals add the groups’ up, so a visitor in two counts twice.
Sessions that sent a form, booked or bought.
Purchases, in minor units.
Revenue less refunds, in minor units.
Example
{ "unavailable": { "reason": "token" }, "by": [ "source" ]}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" }}