# google-analytics.reports.compatibility

Dimensions and metrics compatible with a report's columns

> This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.

Page: https://telipot.com/catalog/tasks/google-analytics.reports.compatibility · Markdown: https://telipot.com/catalog/tasks/google-analytics.reports.compatibility/md · JSON: https://telipot.com/catalog/tasks/google-analytics.reports.compatibility/json

| Field | Value |
| --- | --- |
| provider | [Google Analytics 4](https://telipot.com/catalog/providers/google-analytics) `google-analytics` |
| capability | [`analytics.reports.compatibility`](https://telipot.com/catalog/capabilities/analytics.reports.compatibility) |
| kind | utility |
| tier | core |
| price | Free (Free from the tool) |
| identity | Company account |
| auth | `oauth · OAuth 2.0 with PKCE` |
| scope | own_account |
| principal | organization |
| required_scopes | `analytics.readonly` |
| retention | standard |
| route | `POST https://analyticsdata.googleapis.com/v1beta/properties/{propertyId}:checkCompatibility` |
| verification | Not verified yet. Not checked yet. We test with a real request before we mark it. |
| status | live |
| docs | https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/checkCompatibility |

## Preview the price · nothing runs

```bash
telipot run google-analytics.reports.compatibility \
  --input-json '{"propertyId":"123456789"}' \
  --quote
```

## Run it

```bash
telipot run google-analytics.reports.compatibility \
  --input-json '{"propertyId":"123456789"}'
```

```bash
curl https://api.telipot.com/v1/tasks/google-analytics.reports.compatibility/run \
  -H "Authorization: Bearer $TELIPOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"propertyId":"123456789"}'
```

## Input

| Field | In | Type | Required | Constraints | Note |
| --- | --- | --- | --- | --- | --- |
| `propertyId` | pathParams | string | yes |  | The numeric id of a GA4 property, as google-analytics.accounts.summaries returns it after properties/ |
| `dimensions` | body | array | no |  | The dimensions already in the report, each an object with a name |
| `metrics` | body | array | no |  | The metrics already in the report, each an object with a name |
| `dimensionFilter` | body | object | no |  | The report's dimension filter, if it has one |
| `metricFilter` | body | object | no |  | The report's metric filter, if it has one |
| `compatibilityFilter` | body | string | no | one of "COMPATIBLE", "INCOMPATIBLE" | Keep only the dimensions and metrics of this compatibility; COMPATIBLE lists those that can be added |

## Input schema

```json
{
  "type": "object",
  "properties": {
    "propertyId": {
      "type": "string",
      "description": "The numeric id of a GA4 property, as google-analytics.accounts.summaries returns it after properties/",
      "examples": [
        "123456789"
      ]
    },
    "dimensions": {
      "type": "array",
      "description": "The dimensions already in the report, each an object with a name",
      "examples": [
        [
          {
            "name": "country"
          }
        ]
      ]
    },
    "metrics": {
      "type": "array",
      "description": "The metrics already in the report, each an object with a name",
      "examples": [
        [
          {
            "name": "activeUsers"
          }
        ]
      ]
    },
    "dimensionFilter": {
      "type": "object",
      "description": "The report's dimension filter, if it has one"
    },
    "metricFilter": {
      "type": "object",
      "description": "The report's metric filter, if it has one"
    },
    "compatibilityFilter": {
      "type": "string",
      "description": "Keep only the dimensions and metrics of this compatibility; COMPATIBLE lists those that can be added",
      "enum": [
        "COMPATIBLE",
        "INCOMPATIBLE"
      ]
    }
  },
  "required": [
    "propertyId"
  ],
  "additionalProperties": false
}
```

## Output schema

```json
{
  "type": "object",
  "properties": {
    "dimensionCompatibilities": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "compatibility": {
            "type": "string",
            "description": "COMPATIBLE or INCOMPATIBLE"
          },
          "dimensionMetadata": {
            "type": "object",
            "properties": {
              "apiName": {
                "type": "string"
              },
              "uiName": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "category": {
                "type": "string"
              },
              "customDefinition": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "metricCompatibilities": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "compatibility": {
            "type": "string",
            "description": "COMPATIBLE or INCOMPATIBLE"
          },
          "metricMetadata": {
            "type": "object",
            "properties": {
              "apiName": {
                "type": "string"
              },
              "uiName": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "category": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "customDefinition": {
                "type": "boolean"
              }
            }
          }
        }
      }
    }
  }
}
```

## Example response

From `examples/google-analytics.reports.compatibility.json`.

```json
{
  "dimensionCompatibilities": [
    {
      "compatibility": "COMPATIBLE",
      "dimensionMetadata": {
        "apiName": "city",
        "uiName": "City",
        "description": "The city the user activity came from.",
        "category": "Geography",
        "customDefinition": false
      }
    }
  ],
  "metricCompatibilities": [
    {
      "compatibility": "COMPATIBLE",
      "metricMetadata": {
        "apiName": "sessions",
        "uiName": "Sessions",
        "description": "The number of sessions that began on the site or app.",
        "category": "Session",
        "type": "TYPE_INTEGER",
        "customDefinition": false
      }
    }
  ]
}
```
