Raw schema
{
"type": "object",
"properties": {
"site_id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "The site id, the same string as in the tracking code (e.g. CDBUGS). fathom_list_sites lists them."
},
"entity": {
"type": "string",
"enum": [
"pageview",
"event"
],
"description": "pageview = site traffic; event = one event's conversions (needs event_name)."
},
"event_name": {
"description": "For entity event: the event's name, as listed by fathom_list_events.",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"aggregates": {
"minItems": 1,
"maxItems": 8,
"type": "array",
"items": {
"type": "string",
"enum": [
"visits",
"uniques",
"pageviews",
"avg_duration",
"bounce_rate",
"conversions",
"unique_conversions",
"value"
]
},
"description": "Metrics. pageview: visits, uniques, pageviews, avg_duration, bounce_rate. event: conversions, unique_conversions, value."
},
"date_grouping": {
"description": "Group by time (omit for one total). hour only for ranges up to 7 days.",
"type": "string",
"enum": [
"hour",
"day",
"month",
"year"
]
},
"field_grouping": {
"description": "Group by these fields, e.g. [pathname] or [referrer_source, utm_campaign].",
"minItems": 1,
"maxItems": 6,
"type": "array",
"items": {
"type": "string",
"enum": [
"hostname",
"pathname",
"entry_page",
"exit_page",
"referrer_hostname",
"referrer_pathname",
"referrer_source",
"ai_source",
"browser",
"country_code",
"city",
"state",
"region",
"device_type",
"operating_system",
"utm_campaign",
"utm_content",
"utm_medium",
"utm_source",
"utm_term",
"keyword",
"ref"
]
}
},
"sort_by": {
"description": "\"<field>:asc|desc\" with a field from aggregates or field_grouping (or timestamp with date_grouping), e.g. pageviews:desc.",
"type": "string",
"maxLength": 64
},
"date_from": {
"description": "Start, YYYY-MM-DD (start of day) or \"YYYY-MM-DD HH:MM:SS\", in the site's timezone. Default: the first recorded data.",
"type": "string",
"minLength": 10,
"maxLength": 19
},
"date_to": {
"description": "End, YYYY-MM-DD (end of day) or \"YYYY-MM-DD HH:MM:SS\", in the site's timezone. Default: now.",
"type": "string",
"minLength": 10,
"maxLength": 19
},
"limit": {
"description": "Row cap, 1-1000 (default 500 when grouping by fields).",
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"filters": {
"description": "Filters, all applied (AND). Example: [{\"property\":\"country_code\",\"operator\":\"is\",\"value\":\"GB\"}].",
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"property": {
"type": "string",
"enum": [
"domain",
"hostname",
"pathname",
"entry_page",
"exit_page",
"referrer_hostname",
"referrer_pathname",
"referrer_source",
"ai_source",
"browser",
"country_code",
"city",
"state",
"region",
"device_type",
"operating_system",
"utm_campaign",
"utm_content",
"utm_medium",
"utm_source",
"utm_term",
"ref"
],
"description": "Field to filter on (domain is filter-only; keyword cannot be filtered)."
},
"operator": {
"type": "string",
"enum": [
"is",
"is not",
"is like",
"is not like",
"matching",
"not matching"
],
"description": "is, is not, is like (contains, * wildcards), is not like, matching (regex), not matching. Categorical fields (device_type, operating_system, browser, country_code, city, state, region) allow only is / is not."
},
"value": {
"type": "string",
"maxLength": 1000,
"description": "The value to compare with, always a string (e.g. /pricing, GB, Mobile, ChatGPT)."
}
},
"required": [
"property",
"operator",
"value"
]
}
}
},
"required": [
"site_id",
"entity",
"aggregates"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}