--- title: "Reporting in Connector builder | Supermetrics" slug: "reporting" description: "Learn how to configure report types in connectors, enabling tailored data requests and effective API integration for your data needs." updated: 2026-10-27T15:54:24Z published: 2026-10-27T15:54:24Z canonical: "docs.supermetrics.com/reporting" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.supermetrics.com/llms.txt > Use this file to discover all available pages before exploring further. # Reporting Reports, also known as report types, are the main components of a connector and define: - How data is requested from the API - How the received data is read and interpreted - What fields are made available in the connector A connector can have one or multiple report types, and one report type typically requests data from a one endpoint. If you have multiple endpoints you need data from, you can add multiple report types to the connector. > [!NOTE] > Note > > You will need to configure at least one report type to your connector. Otherwise, the connector does not know what data to fetch. Report type configuration allows you to tailor your connector to fit the requirements of the data source API, be it a simple GET request with JSON response, or a more complex asynchronous reporting flow with a zipped CSV as a response. ## How report types are shown in Supermetrics Report types are visible for the user when they’re building a query in Supermetrics products. All the configured report types are selectable as a dropdown after authenticating to the connector. ![](https://cdn.document360.io/a13cead5-eaae-456f-9bd1-0941d590c0e3/Images/Documentation/Screenshot 2025-12-18 at 13.51.19.png) ## **Structure of report type configuration** Your connector can have one or multiple report types that are configured as an array under the `reporting` object. ```json "reporting": {    "reportTypes": [        {            "id": "report_type_1",            "title": "1st report type"        },        {            "id": "report_type_2",            "title": "2nd report type"        }    ] } ``` Under each report type, you can then define report type-specific [requests](/v1/docs/request-configuration), [settings](/v1/docs/query-settings), [configurations,](/v1/docs/reporting#basic-configurations) and [fields](/v1/docs/reporting#field-configuration-metrics-and-dimensions). Below, we’ll walk you through all the most essential configuration options. ## Basic configurations | Field | Description | | --- | --- | | `id` | Report type ID is used to identify report types. The report type ID must be unique, and it can contain: - Letters (a - z) - Numbers (0 - 9) - Underscore ( _ ) For example: `campaign_performance` | | `title` | The report type title defines the display name for the report type, and it’s shown to the user in Supermetrics products. | | `config` | The `config` object allows you to configure various configurations related to a report type. For example: - Does the report type allow date range filtering - Which field to use for date range filtering - How to split a request to smaller batches - From what date onwards the data is available See the [Report type configuration](/v1/docs/reporting#report-type-configuration) section for more details | | `request` | The `request` object allows you to configure the type of request sent to the data source API to fetch data, and how the response is processed (including reshaping it with data adapters when needed). See [Request configuration](/v1/docs/request-configuration) and [Transforming response structure](/v1/docs/transforming-response-structure) for further details. | | `settings` | Query settings available for the user of the connector, which can be used to alter requests. For example, if the API allows a currency parameter to be passed as part of the request, you can define a dropdown of currencies for the user to select, and then pass the selected currency to the API request via a placeholder. See [Query settings](/v1/docs/query-settings) and [Placeholders](/v1/docs/placeholders#available-placeholders) for more information. | | `metrics` | Under metrics, you can define an array of metric fields to be available in the connector. Metric fields are aggregated during the data processing. See [field configuration](/docs/reporting#field-configuration-metrics-and-dimensions) for more information. | | `dimensions` | Under dimensions, you can define an array of dimension fields to be available in the connector. Dimension fields allow you to split your metric data into segments. See [field configuration](/docs/reporting#fields-configuration-metrics-and-dimensions) for more information. | ### Report type configuration Each report type can include a `config` object that controls how the report type behaves — what's shown to the user, how the date range works, how queries are split, how far back data goes, and more. All fields are optional; set only the ones you need. ```json "reporting": {  "reportTypes": [    {      "id": "campaigns",      "title": "Campaigns",      "config": {        "showDateRange": true,        "maxDaysPerRequest": 90,        "splitRequestsToMonths": false      }    }  ] } ``` | Field | Type | What it controls | | --- | --- | --- | | `isVisible` | boolean | Whether the report type is shown to users. A hidden report type (`false`) is useful when combining data from multiple report types within one visible report. Defaults to `true`. | | `showDateRange` | boolean | Whether the date range selector is shown for this report type. Defaults to `true`. See more details about [Date range configuration](/v1/docs/reporting#step-1-enable-date-range-filtering-and-default-date-fields-in-the-connector). | | `queryStartDateModification` | object | Shifts the query's start date by a PHP relative-time string before the request is sent. See [Modifying the query date range](/v1/docs/reporting#modifying-the-query-date-range) for more information. | | `queryEndDateModification` | object | Shifts the query's end date by a PHP relative-time string before the request is sent. See [Modifying the query date range](/v1/docs/reporting#modifying-the-query-date-range) for more information. | | `showDefaultDateFields` | boolean | Whether to expose the built-in date dimensions, which are calculated from a base field. Defaults to `false`. See more details about [Date range configuration](/v1/docs/reporting#step-1-enable-date-range-filtering-and-default-date-fields-in-the-connector). | | `readDateFrom` | string (field ID) | The field used as the source for those default date fields. See more details about [Date range configuration](/v1/docs/reporting#step-1-enable-date-range-filtering-and-default-date-fields-in-the-connector). | | `dataAvailableSince` | string (date) | The earliest date the data source has data for, for example `2017-08-13`. | | `maxDataAgeDays` | integer | How many days into the past the data source serves data — a rolling window (for example, some APIs only allow fetching the last 60 days). | | `splitToCalendarPeriods` | string | Splits queries per calendar period: `none`, `month`, `week`, or `sunday_week`. Useful for caching and for data sources that only return aggregated data. | | `splitRequestsToMonths` | boolean | Whether to split queries into month periods. Defaults to `true` when `splitToCalendarPeriods` isn't set. | | `maxDaysPerRequest` | integer | The maximum number of days in a single request; longer ranges are split into multiple requests (for example, `14` splits a 30-day range into 14 + 14 + 2). | | `maxMetricsPerRequest` | integer | The maximum number of metrics per outgoing request; extra metrics are split into more requests. `0` means no limit. | | `resultFiltering` | object | Filters the returned rows after query has run, before writing results to destination — either by date range (keep only rows inside the requested range) or by a conditional check on row values. See [Result filtering](/v1/docs/reporting#result-filtering) for more details. | ### Date range configuration Most of the datasets that you work with contain one or multiple date values, for example: - Campaign performance data broken down by date - Ecommerce order data containing order creation date, modification date, and shipping date Most APIs also allow you to filter the data by date in the data fetching request. In this section, we’ll show you how to configure date range filtering for your connector. Configuring date range filtering involves a few steps: 1. Enabling date range filtering and default date fields in the connector 2. Configuring start and end date parameters to be sent as part of the request 3. Defining the field that’s used to filter the data by date Let’s go through each of the steps. #### Step 1: Enable date range filtering and default date fields in the connector For the connector to show a date range selection when building a query, the date range filtering must be enabled in the connector. Below you can see an example of how a report type **with** or **without** date range filtering looks when using a connector. When the API provides date-based data, we also usually configure **a default set of date fields** to be available for the user of the connector, which allows users to aggregate the data for different time granularities (date, week, month, year, and so on). ![](https://cdn.document360.io/a13cead5-eaae-456f-9bd1-0941d590c0e3/Images/Documentation/Screenshot 2025-12-19 at 11.09.21.png) To enable showing the date range selection and default date fields in the connector, configure `showDateRange` and `showDefaultDateFields` under `config` for a report type. Like this: ```json "reporting": {    "reportTypes": [        {            "id": "campaign_performance",            "title": "Campaign performance",            "config": {                "showDateRange": true,                "showDefaultDateFields": true            }        }    ] } ``` **Note**: If the API doesn't support date-range filtering, you can filter the returned rows by date after fetching — see [Result filtering](/v1/docs/reporting#filtering). #### Step 2: Configure start and end date parameters to be sent as part of the request When the connector shows the date range selection, we want to ensure that whatever the user selects as the date range of the query, is also sent as part of the API request. This is done using [placeholders](/v1/docs/placeholders#query-placeholders) in the [request configuration](/v1/docs/request-configuration). Let’s assume that the API we’re using accepts `starting_from` and `until_to` parameters to define the date range for which data is returned, and the date must be sent in the `YYYY-MM-DD` format. The report configuration would look like this: ```json "reporting": {    "reportTypes": [        {            "id": "campaign_performance",            "title": "Campaign performance",            "config": {                "showDateRange": true,                "showDefaultDateFields": true            },            "request": {                "method": "GET",                "url": "https://api.example.com",                "parameters": [                    {                        "name": "starting_from",                        "value": "{{query.start_date_time.date}}"                    },                    {                        "name": "until_to",                        "value": "{{query.end_date_time.date}}"                    }                ]            }        }    ] } ``` #### Step 3: Define the field used for filtering the data by date When we’re successfully sending the date range filtering parameters to the API, and we have configured a set of ready date fields for the user to aggregate the data for different granularities, we next need to explain to our system which field to use as a base for all the date operations. Let’s assume the API returns order data, and you want the orders to be aggregated by order creation date. This order creation date is returned in the API response in the `date_of_order` value. We’ll configure: - A dimension for Order date with the following details: - Display name (label): `Order date` - ID: `order_date` - Data type: `string.time.date` - Value for the field to come from `jsonPath` (JSON response provided by the API), and we read the value from the `date_of_order` field - We configure `readDateFrom` under the `config` object to pinpoint to this `order_date` field we just created. The full configuration would look like this: ```json "reporting": {    "reportTypes": [        {            "id": "campaign_performance",            "title": "Campaign performance",            "config": {                "showDateRange": true,                "showDefaultDateFields": true,                "readDateFrom": "order_date"            },            "request": {                "method": "GET",                "url": "https://api.example.com",                "parameters": [                    {                        "name": "starting_from",                        "value": "{{query.start_date_time.date}}"                    },                    {                        "name": "until_to",                        "value": "{{query.end_date_time.date}}"                    }                ]            },            "dimensions": {                "groups": [                    {                        "label": "DIMENSIONS",                        "fields": [                            {                                "id": "order_date",                                "label": "Order date",                                "dataType": "string.time.date",                                "value": {                                    "source": "jsonPath",                                    "value": "$.date_of_order"                                }                            }                        ]                    }                ]            }        }    ] } ``` #### Modifying the query date range Some APIs interpret the requested date range differently from how the user selects it. Two `config` options adjust the dates actually sent in the request, without changing what the user picked: - `queryStartDateModification` — shifts the sent start date. Useful when the API needs data from earlier than the user selected, for example a lead-in period. - `queryEndDateModification` — shifts the sent end date. Most often used when the API treats the end of the range as exclusive (midnight to midnight), so a single-day selection would otherwise return no data, and longer date ranges would exclude the end date’s data. The `applyOnlyForToday` and `excludeToday` options control when the shift applies — for example to pull the end date back only when the range ends today, or excluding today’s date range from the modification in case the source API does not accept fetching data for future dates. Both take a `modification` value: a PHP relative-time string such as `"+1 day"` or `"-7 days"`. For an API where the end date is exclusive, add one day to the end date so the selected end date is included: ```json "config": {  "queryEndDateModification": {    "modification": "+1 day"  } } ``` A `2024-05-10` to `2024-05-10` selection is then sent as `2024-05-10` to `2024-05-11` to the outgoing API request, returning the full day's data. ### Result filtering The resultFiltering object (set on a report type's config) filters the rows returned by the API after they're fetched. It's useful when the API returns more rows than you want and can't narrow them down itself. There are two modes, which can be used together: - `dateRange` — keep only rows whose date falls within the requested range. - `conditional` — keep or drop rows based on a check against their values. #### Filtering by date range Some APIs ignore the requested date range and return all rows regardless. If each row includes a date field, point `dateRange.filteringValue` at it — only rows whose date falls within the query's start and end date are kept: ```json "config": {  "resultFiltering": {    "dateRange": {      "enabled": true,      "filteringValue": {        "source": "jsonPath",        "value": "$.Day"      }    }  } } ``` By default, rows whose date can't be parsed are dropped; set `excludeRowsWithInvalidDate` to `false` to keep them instead. **Note:** Date range filtering only applies to requests run in a query context, where a start and end date exist — it has no effect on account or segment fetchers. #### Filtering by condition Conditional filtering keeps or drops rows based on a check against a value in each row. Under conditional.filter.items, each entry defines: - `value` — the value to check (most often a jsonPath into the row). - `is` — the row is kept when the value matches the check. - `not` — the row is kept when the value does not match the check (matching rows are dropped). When several items are listed, a row must pass all of them to be kept. The available checks are: | Check | Meaning | | --- | --- | | `equals` | Matches the value exactly (case-sensitive). | | `beginsWith` | Value begins with the string (case-insensitive). | | `endsWith` | Value ends with the string (case-insensitive). | | `contains` | Value contains the string (case-insensitive). | | `regEx` | Value matches the regular expression (case-insensitive). | | `isWithinRange` | Value falls within a `min`/`max` range. | | `isNull` | Value is null. | | `exists` | Value is defined (any non-null value). | | `isTrue` / `isFalse` | Value is `true` / `false`. | For example, to keep only the rows belonging to the selected account: ```json "config": {  "resultFiltering": {    "conditional": {      "enabled": true,      "filter": {        "items": [          {            "value": {              "source": "jsonPath",              "value": "$.advertiser_id"            },            "is": {              "equals": "{{account.id}}"            }          }        ]      }    }  } } ``` Or to drop a summary row the API includes in the data: ```json {  "value": {    "source": "jsonPath",    "value": "$.demographics"  },  "not": {    "equals": "Persons 2+"  } } ``` **Note:** The `resultFiltering` can also be applied to an individual request, under that request's `response.filtering`, using the same `dateRange` and `conditional` structure. Setting it on the report type's `config` filters the report type's final, combined result — after all requests are fetched and after potential result merging of multiple report types has been completed — so it's the right choice for most cases, and the only place you can filter on values added when combining data from multiple report types. Setting `filtering` on an individual request's `response` instead filters that single request's rows earlier, before merging — use it when you need to trim one request's response on its own. ### Field configuration (metrics and dimensions) Configuring the fields for your connector is an essential part in defining what data is available in the connector. Fields are divided into two categories: - **Dimensions**: Descriptive attributes used to segment data, splitting your metrics into different categories. Common dimensions include, for example, campaign, country, device, contact ID, and order time. - **Metrics**: Quantitative measurements used to provide specific numbers about behavior or performance. One way to think about metrics is that you can apply mathematical operations to them, such as summing them or calculating an average. Common metrics are, for example, spend, impressions, clicks, click-through rate, conversion rate, cost per acquisition, and return on investment (ROI). When configuring fields to your connector, you need to configure each field under `dimensions` or `metrics` , so we know whether the field should be used to segment or to aggregate your data. You can configure as many fields in your connector as you want. Example configuration for fields split to dimensions and metrics looks like this: ```json {    "dimensions": {        "groups": [            {                "label": "DIMENSIONS",                "fields": [                    {                        "id": "campaign_id",                        "label": "Campaign ID",                        "dataType": "string.text.value",                        "value": {                            "source": "jsonPath",                            "value": "$.campaign_id"                        }                    }                ]            }        ]    },    "metrics": {        "groups": [            {                "label": "METRICS",                "fields": [                    {                        "id": "impressions",                        "label": "Impressions",                        "dataType": "int.number.value",                        "value": {                            "source": "jsonPath",                            "value": "$.impressions"                        },                        "aggregationType": "sum"                    }                ]            }        ]    } } ``` #### Field properties Below you can find what different properties you should configure for your fields. | Property | Description | | --- | --- | | `id` | The unique identifier of the field. It’s recommended to set this to be the API field name. Only lowercase letters, digits, and underscores are allowed. | | `label` | The display name of the field. The display name is shown to users in Supermetrics products. | | `description` | The description shows up as a tooltip when hovering over the field in Supermetrics products. | | `dataType` | Data type of the field. Each field needs to be mapped to one of the pre-defined data types used across Supermetrics products. This ensures that we’re able to handle the data correctly and send it in a correct format to the destination you want to use the data in. Most common data types include: - `string.text.value` for generic text values - `string.time.date` for date in format YYYY-MM-DD - `int.number.value` for numerical values in integer format (such as 67) - `float.number.value` for numerical values in decimal format (ie. 1.23) All the available data types are [documented here](https://docs.supermetrics.com/apidocs/field-data-types). | | `value` | Value defines how we get the value of the field we return to the user. This is defined as `source` and `value` combination. A most common configuration is to have `source` as `jsonPath` to read the value from the API response, and `value` defining the actual JSONpath used to find the field. For example: ```json "value": { "source": "jsonPath", "value": "$.impressions" } ``` | | `aggregationType` | **ONLY FOR METRICS FIELDS** Defines how the values of this field will be aggregated. Most common approach is to `sum` field values together. Available options: - sum - avg - concat_unique - count - count_including_empty - count_unique - count_unique_including_empty - first - last - max - min - not_allowed | #### Processing field values A metric or dimension field doesn't have to return the raw value from the API. You can **calculate** a field's value from other fields (for example a rate derived from two fields), and **format** the returned value (for example turning a timestamp into a date or rounding a number). Both are defined on the field itself, with the calculation applied first and formatting applied to the result. For the full list of calculation and formatting operations, their parameters, and examples, see [**Field calculations and value formatting**](/v1/docs/field-calculations-and-value-formatting). ### Query settings Query settings let the user configure characteristics of a query — for example a reporting timezone, a currency, or a filter. They're defined per report type under a `settings` object, and the value the user selects becomes available in requests through the `{{query.settings.<id>}}` placeholder. You can offer the user a dropdown of fixed or dynamically-fetched options, or a free-text input, and a single selection can even supply several values to different parts of a request. For the full configuration — setting types, static and dynamic options, and attaching multiple values to one option — see [**Query settings**](/v1/docs/query-settings). ## Combining data from multiple report types When a single report needs fields from more than one API endpoint, you can join data across report types so the final rows include fields from each. The parent report type contributes the base rows, and one or more child report types contribute additional fields on each row. This is configured under the `decoration` property of the parent report type. The child report types are usually hidden from the connector – the user only sees and selects the parent report, and the joined fields appear alongside the parent's own fields on each row. See [**Joining data**](/v1/docs/joining-data) for the patterns (one-to-one and one-to-many joins, batching of child requests to cut down API calls, and chaining joins across multiple report types). ## Report type configuration template ```json "reporting": {    "reportTypes": [        {            "id": "[report_id]",            "title": "[report_id]",            "request": {                "method": "GET",                "url": "[endpoint URL]",                "headers": [                    {                        "name": "Authorization",                        "value": "{{user.access_token}}"                    }                ],                "parameters": [                    {                        "name": "start_date",                        "value": "{{query.start_date_time.date}}"                    },                    {                        "name": "end_date",                        "value": "{{query.end_date_time.date}}"                    }                ],                "response": {                    "type": "JSON",                    "dataRows": {                        "source": "jsonPath",                        "value": "$[json path to data rows in the response]"                    },                    "pagination": {                        "type": "none"                    }                }            },            "dimensions": {                "groups": [                    {                        "label": "Dimension group name",                        "fields": [                            {                                "id": "field_id",                                "label": "field display name",                                "dataType": "string.text.value",                                "value": {                                    "source": "jsonPath",                                    "value": "$[jsonpath to field in API response]"                                }                            }                        ]                    }                ]            },            "metrics": {                "groups": [                    {                        "label": "Metrics group name",                        "fields": [                            {                                "id": "field_id",                                "label": "field display name",                                "dataType": "int.number.value",                                "aggregationType": "sum",                                "value": {                                    "source": "jsonPath",                                    "value": "$[jsonpath to field in API response]"                                }                            }                        ]                    }                ]            }        }    ] } ```