Example Queries
Check Data Readiness
query DataReadiness (
$clientId: ID!
) {
marketingDataReadiness(
clientId: $clientId
) {
status
lastProcessedAt
}
}
Example variables:
{
"clientId": "f0cacc1a"
}
Minimal Marketing Records Query
The smallest query that returns useful data. No filters — returns all markets and all sources your credentials have access to. Use this as your starting point and add filters from there.
query MarketingRecords (
$clientId: ID!
$dateRange: DateRangeInput!
$currency: Currency
) {
marketingRecords(
clientId: $clientId
dateRange: $dateRange
currency: $currency
) {
data {
dateDay
market
source
cost
impressions
clicks
}
metadata {
totalRecords
currency
}
}
}
Example variables:
{
"clientId": "f0cacc1a",
"dateRange": {
"startDate": "2024-01-01",
"endDate": "2024-01-31"
},
"currency": "GBP"
}
Basic Marketing Records Query
A more complete query showing all common arguments — filters, sorting, and pagination. The example variables below filter to UK-market records only; remove filter.markets to return data across all markets your credentials cover.
query MarketingRecordsFiltered (
$clientId: ID!
$dateRange: DateRangeInput!
$currency: Currency
$filter: MarketingFilter
$sort: [MarketingSort!]
$pagination: PaginationInput
) {
marketingRecords(
clientId: $clientId
dateRange: $dateRange
currency: $currency
filter: $filter
sort: $sort
pagination: $pagination
) {
data {
dateDay
market
source
impressions
clicks
visits
}
pagination {
currentPage
pageSize
totalItems
totalPages
hasNextPage
hasPreviousPage
}
metadata {
totalRecords
executionTimeMs
currency
}
}
}
Example variables:
{
"clientId": "f0cacc1a",
"dateRange": {
"startDate": "2024-01-01",
"endDate": "2024-01-31"
},
"currency": "GBP",
"filter": {
"markets": ["UK"]
},
"sort": [
{
"field": "DATE_DAY",
"direction": "DESC"
}
],
"pagination": {
"page": 1,
"pageSize": 5000
}
}
Paid Campaigns in Germany
query PaidCampaignsGermany (
$clientId: ID!
$dateRange: DateRangeInput!
$currency: Currency
$filter: MarketingFilter
$sort: [MarketingSort!]
$pagination: PaginationInput
) {
marketingRecords(
clientId: $clientId
dateRange: $dateRange
currency: $currency
filter: $filter
sort: $sort
pagination: $pagination
) {
data {
cost
salesPlatform
fosphaCAC
}
pagination {
currentPage
pageSize
totalItems
totalPages
hasNextPage
hasPreviousPage
}
metadata {
totalRecords
executionTimeMs
currency
}
}
}
Example variables:
{
"clientId": "f0cacc1a",
"dateRange": {
"startDate": "2023-09-01",
"endDate": "2023-09-28"
},
"currency": "GBP",
"filter": {
"markets": ["DE"],
"isPaidCampaign": true,
"excludeZeroCost": true
},
"sort": [
{
"field": "COST",
"direction": "DESC"
}
],
"pagination": {
"pageSize": 5000
}
}
Aggregated Analytics Query
query MarketingAggregateSimple(
$clientId: ID!
$dateRange: DateRangeInput!
$currency: Currency
$groupBy: [MarketingDimension!]!
$metrics: [MarketingMetric!]!
$filter: MarketingFilter
$sort: [AggregateSort!]
$pagination: PaginationInput
) {
marketingAggregate(
clientId: $clientId
dateRange: $dateRange
currency: $currency
groupBy: $groupBy
metrics: $metrics
filter: $filter
sort: $sort
pagination: $pagination
) {
data {
market
source
totalCost
totalImpressions
totalClicks
recordCount
}
pagination {
currentPage
pageSize
totalItems
totalPages
hasNextPage
hasPreviousPage
}
metadata {
totalRecords
executionTimeMs
currency
}
}
}
Example variables:
{
"clientId": "f0cacc1a",
"dateRange": {
"startDate": "2023-09-01",
"endDate": "2023-11-29"
},
"currency": "GBP",
"groupBy": ["MARKET", "SOURCE"],
"metrics": ["COST", "IMPRESSIONS", "CLICKS"],
"filter": {
"markets": ["DE"]
},
"sort": [
{
"field": "TOTAL_COST",
"direction": "ASC"
}
],
"pagination": {
"pageSize": 5000
}
}
Incremental Forecasting Summary
Returns saturation diagnostics and rolling spend/target windows from the latest
model run per segment. The example variables below filter to the UK market;
omit market to return every market your credentials cover.
query IncrementalForecastingSummary (
$clientId: ID!
$currency: Currency
$market: String
) {
incrementalForecastingSummary(
clientId: $clientId
currency: $currency
market: $market
) {
data {
market
channelSegment
paidSource
targetType
goalName
saturationPoint
headroom
avg7DaySpend
avg7DayTarget
total30DaySpend
}
pagination {
totalItems
totalPages
hasNextPage
}
metadata {
totalRecords
currency
clientId
}
}
}
Example variables:
{
"clientId": "f0cacc1a",
"currency": "GBP",
"market": "UK"
}