How a client's catalog of metrics and dimensions is built, how fields roll up, unified and custom fields, how a query runs, and the schema response.
The data model is the catalog of every metric and dimension a client can query. Jepto builds it per client from the sources connected to that client, adds unified fields that span ad platforms and your custom fields, and uses it to check, route and calculate every query. The same data model serves the REST and GraphQL APIs, Jepto MCP and Jepto’s own reports, so a field means the same thing everywhere.
| Layer | Field names | Where it comes from |
|---|---|---|
| Platform fields | googleAds.campaignName, googleAnalytics4.sessions | Each connected source contributes its own fields. Jepto defines them per platform, with labels, types, formats and aggregations. |
| Entity fields | aiVisibility.answers.platform | Sources with several kinds of record (entities) prefix the entity: {source}.{entity}.{field} |
| BigQuery fields | bigQuery.a1b2c3d4e5f6a7b8.order_total | Columns of a BigQuery table connected as a data source: bigQuery.{id}.{column}, where {id} identifies the table. Column names keep their original spelling. |
| Unified fields | unified.spend, unified.source | Jepto fields that map to the matching field on each ad platform. Present when the client has more than one source, or has custom fields. |
| Custom fields | custom_a1b2c3d4e5f6a7b8 | Formulas defined in your Jepto account, either account-wide or for one client |
The data model only contains fields the client can actually query. Connect a source and its fields appear; disconnect it and they go.
| Key | Platform |
|---|---|
googleAds | Google Ads |
facebookAds | Meta (Facebook) Ads |
instagramAds | Instagram Ads |
googleAnalytics4 | Google Analytics 4 |
googleSearchConsole | Google Search Console |
googleBusinessProfile | Google Business Profile |
microsoftAds | Microsoft Advertising |
linkedInAds | LinkedIn Ads |
tiktokAds | TikTok Ads |
twitterAds | X (Twitter) Ads |
shopify | Shopify |
xero | Xero |
aiVisibility | Jepto AI Visibility |
unified | Cross-platform fields |
bigQuery | Google BigQuery tables you connect |
Read the schema with clientId: "all_clients" to get the account-wide data model. It’s the union of every client’s data model, not the fields all clients share:
| Includes | Detail |
|---|---|
| Every source type connected to any client | If one client has TikTok Ads, TikTok fields are listed |
| Unified fields | When the account has more than one source type |
| Account-wide custom fields | Available to every client |
| Every client’s own custom fields | Listed even though only that client can query them |
The response doesn’t say which clients have each field. A field in the account-wide data model may not exist for a particular client, so read that client’s schema before querying it. Use the account-wide data model to build field pickers, documentation or mappings across clients.
"all_clients" is for reading the schema only. Data queries always run for one client: POST /query and analyticsQuery reject "all_clients" with INVALID_REQUEST. For several clients, list them with GET /clients and send one query per client.
kind: "metric") are numbers. They go in measures, and each knows how to combine across rows.kind: "dimension") are values to group and filter by. They go in dimensions and filters.{source}.date, with isDefaultDateField: true. It goes in timeDimensions, never in dimensions.Rolling up is a property of the field, not of the query. When a query groups rows (by campaign, by week, or into one total), each metric combines its values with its aggregation:
| Value | Combines rows by | Typical fields |
|---|---|---|
sum | Adding values | Spend, clicks, impressions, conversions |
avg | Averaging values | Values that are already rates, with no formula to recalculate them |
min | Smallest value | First-seen dates, minimum bids |
max | Largest value | Reach-style metrics that can’t be added up |
count | Counting non-null values | Record counts |
count_distinct | Counting distinct values | Unique IDs |
Override a metric’s aggregation for one query with measureAggregations. See Data Queries.
Some metrics can’t be combined by a simple aggregation. Adding up daily CTRs gives the wrong answer, and so does adding up daily unique users. These metrics have a periodRollup that tells Jepto how to build the value for any period:
| periodRollup | How the value is built | Example |
|---|---|---|
formula | Recalculated after aggregation from its component metrics, using formula | googleAds.ctr = clicks ÷ impressions, over the whole period |
weightedAverage | Averaged across rows, weighted by the metric named in weightedBy | Average position weighted by impressions |
apiPeriod | Requested from the platform for each period, because the platform deduplicates across days | googleAnalytics4.totalUsers by month |
periodRollup can’t take a measureAggregations override.apiPeriod metric needs one platform request per time bucket, up to 36 per query. A year of weekly buckets (52) is rejected; use month or a shorter range.dateGrain is the finest period a metric is stored at. A metric stored by month can be bucketed by month, quarter or year, but not by day or week. Distinct-count metrics must be bucketed at exactly their grain.
A unified field reads the matching field on every platform that has one, then combines them with the field’s own rollup. unified.spend reads Cost on Google Ads, Amount spent on Meta and Spend on TikTok and adds them up. Group by unified.source to get one row per platform, and use unified.date as the time dimension.
unified.ctr only includes platforms that map every input of its formula, so a platform never contributes one side of a ratio.dataSources lists exactly which platforms it reads for this client.Custom fields are formulas over other fields, such as blended ROAS or spend after fees. You define them in Jepto; through the API you query them like any other field by their custom_{id} name, and Jepto expands the formula before running the query.
isCustomField: true and keep their bare custom_{id} name, with no source prefix.INVALID_QUERY.measures; they can’t be used as dimensions.
Every query, from the API, Jepto MCP or a report card, goes through the same steps:
| Step | What happens |
|---|---|
| 1. Check | Every field, operator, token and granularity is checked against the client’s data model and the query rules. Anything unknown is rejected before data is fetched. |
| 2. Resolve dates | Relative tokens such as lastMonth become dates in the query’s timezone. |
| 3. Expand custom fields | Each custom_{id} field is replaced by its formula over platform fields. |
| 4. Route | Field names are grouped by source prefix. Unified fields fan out to every platform they map to. |
| 5. Result cache | If the same query ran in the last 12 hours, its result is returned straight away. |
| 6. Fetch rows | Each source returns rows for the date range. Date spans already fetched are read from Jepto’s row cache; only missing spans are requested from the platform. |
| 7. Combine | Rows from all sources are stacked (a union, not a join), dimension filters applied, rows grouped by your dimensions and time bucket, and each metric aggregated with its aggregation. |
| 8. Calculate | Formula metrics, weighted averages and custom fields are calculated from the aggregated values. Metric filters, order, limit and offset are applied. |
| 9. Return | The result is cached (unless it’s empty) and returned with an annotation for each field. |
renewQuery: true is slower: it skips both caches for the query’s date range.
POST /schema (REST) and analyticsSchema (GraphQL) return the data model as { sources, metrics, dimensions }. Parameters are in REST API.
200 OK{
"sources": [
{
"dataSourceId": "a1b2c3d4e5f6g7h8",
"type": "googleAds",
"label": "Google Ads"
},
{
"dataSourceId": "b1c2d3e4f5g6h7i8",
"type": "googleAnalytics4",
"label": "Google Analytics4"
},
{ "type": "unified", "label": "Unified Schema" }
],
"metrics": [
{
"name": "googleAds.spend",
"label": "Cost (spend)",
"kind": "metric",
"type": "number",
"format": { "type": "currency", "precision": 2 },
"aggregation": "sum",
"sourceGroup": "googleAds",
"dataSources": ["googleAds"],
"isCustomField": false,
"dateGrain": "day"
},
{
"name": "googleAds.ctr",
"label": "CTR",
"kind": "metric",
"type": "number",
"format": { "type": "percentage", "precision": 2 },
"aggregation": "avg",
"periodRollup": "formula",
"formula": "googleAds.clicks / googleAds.impressions",
"sourceGroup": "googleAds",
"dataSources": ["googleAds"],
"isCustomField": false
}
],
"dimensions": [
{
"name": "googleAds.campaignName",
"label": "Campaign",
"kind": "dimension",
"type": "string",
"sourceGroup": "googleAds",
"dataSources": ["googleAds"],
"isCustomField": false
}
]
}| Field | Type | Description |
|---|---|---|
type | string | Source key, such as googleAds, bigQuery or unified |
label | string | Display name |
dataSourceId | string or absent | The connection ID, such as ds_a1b2c3d4e5f6a7b8 for a BigQuery table. Absent for unified; equal to type for aiVisibility. |
Each source type appears once, except bigQuery, which appears once per connected table. Sources are sorted by label.
| Field | Type | Description |
|---|---|---|
name | string | The field name to use in queries. Case-sensitive. |
label | string | Display name shown in Jepto |
kind | string | metric (goes in measures) or dimension (goes in dimensions and filters) |
type | string | Value type: number, string or boolean; BigQuery date and timestamp columns are time. Treat unknown values as strings. |
format | object | Optional. Display format: type (number, currency, percentage or decimal), precision (decimal places) and an optional suffix. Use it to show values the way Jepto does. |
description | string | Optional. What the field measures. |
aggregation | string | Metrics only: sum, avg, min, max, count or count_distinct |
periodRollup | string | Some metrics: formula, weightedAverage or apiPeriod. See Period rollups. |
formula | string | With periodRollup: formula. The calculation in field names, for example a CTR of clicks divided by impressions. |
weightedBy | string | With periodRollup: weightedAverage. The metric used as the weight. |
dateGrain | string | Some metrics. The finest granularity the metric can be bucketed by. |
sourceGroup | string | Source key the field belongs to |
dataSources | string[] | Sources the field reads. Unified and custom fields can list several. |
isCustomField | boolean | true for custom fields |
isDefaultDateField | boolean | Date dimensions only. true for the field to use in timeDimensions. |
Fields can be added at any time as sources or custom fields change, so read the schema rather than hard-coding the full list.