{
  "url": "https://telipot.com/catalog/tasks/google-analytics.reports.realtime",
  "id": "google-analytics.reports.realtime",
  "name": "Realtime metrics by dimension for a property",
  "provider": {
    "slug": "google-analytics",
    "name": "Google Analytics 4"
  },
  "capability": "analytics.reports.realtime",
  "platform": "analytics",
  "kind": "data",
  "tier": "core",
  "identity": "account",
  "identityLabel": "Company account",
  "price": {
    "amount": "Free",
    "state": "free",
    "label": "Free",
    "detail": "Free from the tool",
    "type": "free"
  },
  "providers": 1,
  "retention": "standard",
  "runsOn": "free",
  "live": true,
  "summary": "Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties).",
  "method": "POST",
  "path": "/v1beta/properties/{propertyId}:runRealtimeReport",
  "host": "https://analyticsdata.googleapis.com",
  "docsUrl": "https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runRealtimeReport",
  "auth": {
    "scheme": "oauth",
    "label": "oauth · OAuth 2.0 with PKCE",
    "short": "oauth · OAuth 2.0"
  },
  "scope": "own_account",
  "principal": "organization",
  "requiredScopes": [
    "analytics.readonly"
  ],
  "verification": {
    "state": "none",
    "label": "Not verified yet",
    "detail": "Not checked yet. We test with a real request before we mark it."
  },
  "input": [
    {
      "name": "propertyId",
      "location": "pathParams",
      "type": "string",
      "required": true,
      "constraints": [],
      "note": "The numeric id of a GA4 property, as google-analytics.accounts.summaries returns it after properties/"
    },
    {
      "name": "dimensions",
      "location": "body",
      "type": "array",
      "required": false,
      "constraints": [],
      "note": "Each an object with the name of a dimension the realtime report offers, such as country or unifiedScreenName"
    },
    {
      "name": "metrics",
      "location": "body",
      "type": "array",
      "required": true,
      "constraints": [],
      "note": "Each an object with the name of a metric the realtime report offers, such as activeUsers or eventCount"
    },
    {
      "name": "minuteRanges",
      "location": "body",
      "type": "array",
      "required": false,
      "constraints": [],
      "note": "Up to 2 ranges, each a startMinutesAgo and an endMinutesAgo; the last 30 minutes when absent"
    },
    {
      "name": "dimensionFilter",
      "location": "body",
      "type": "object",
      "required": false,
      "constraints": [],
      "note": "A filter expression over dimensions, applied before the metrics are aggregated"
    },
    {
      "name": "metricFilter",
      "location": "body",
      "type": "object",
      "required": false,
      "constraints": [],
      "note": "A filter expression over metrics, applied after the rows are aggregated"
    },
    {
      "name": "orderBys",
      "location": "body",
      "type": "array",
      "required": false,
      "constraints": [],
      "note": "How the rows are ordered, each an order by a dimension or a metric"
    },
    {
      "name": "limit",
      "location": "body",
      "type": "integer",
      "required": false,
      "constraints": [
        "1 to 250000",
        "default 10000"
      ],
      "note": "Rows to return; a report can return fewer"
    },
    {
      "name": "metricAggregations",
      "location": "body",
      "type": "array",
      "required": false,
      "constraints": [],
      "note": "TOTAL, MINIMUM or MAXIMUM, each adding a row of that aggregate of every metric"
    },
    {
      "name": "returnPropertyQuota",
      "location": "body",
      "type": "boolean",
      "required": false,
      "constraints": [
        "default false"
      ],
      "note": "Whether to add the property's quota state to the answer"
    }
  ],
  "sampleInput": {
    "propertyId": "123456789",
    "metrics": [
      {
        "name": "activeUsers"
      }
    ]
  },
  "inputSchema": {
    "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": "Each an object with the name of a dimension the realtime report offers, such as country or unifiedScreenName",
        "examples": [
          [
            {
              "name": "country"
            }
          ]
        ]
      },
      "metrics": {
        "type": "array",
        "description": "Each an object with the name of a metric the realtime report offers, such as activeUsers or eventCount",
        "examples": [
          [
            {
              "name": "activeUsers"
            }
          ]
        ]
      },
      "minuteRanges": {
        "type": "array",
        "description": "Up to 2 ranges, each a startMinutesAgo and an endMinutesAgo; the last 30 minutes when absent",
        "examples": [
          [
            {
              "startMinutesAgo": 29,
              "endMinutesAgo": 0
            }
          ]
        ]
      },
      "dimensionFilter": {
        "type": "object",
        "description": "A filter expression over dimensions, applied before the metrics are aggregated"
      },
      "metricFilter": {
        "type": "object",
        "description": "A filter expression over metrics, applied after the rows are aggregated"
      },
      "orderBys": {
        "type": "array",
        "description": "How the rows are ordered, each an order by a dimension or a metric"
      },
      "limit": {
        "type": "integer",
        "description": "Rows to return; a report can return fewer",
        "default": 10000,
        "minimum": 1,
        "maximum": 250000
      },
      "metricAggregations": {
        "type": "array",
        "description": "TOTAL, MINIMUM or MAXIMUM, each adding a row of that aggregate of every metric"
      },
      "returnPropertyQuota": {
        "type": "boolean",
        "description": "Whether to add the property's quota state to the answer",
        "default": false
      }
    },
    "required": [
      "propertyId",
      "metrics"
    ],
    "additionalProperties": false
  },
  "output": [
    {
      "name": "dimensionHeaders",
      "type": "object[]"
    },
    {
      "name": "metricHeaders",
      "type": "object[]"
    },
    {
      "name": "rows",
      "type": "object[]",
      "description": "Absent when no row matches"
    },
    {
      "name": "totals",
      "type": "object[]"
    },
    {
      "name": "maximums",
      "type": "object[]"
    },
    {
      "name": "minimums",
      "type": "object[]"
    },
    {
      "name": "rowCount",
      "type": "integer"
    },
    {
      "name": "propertyQuota",
      "type": "object",
      "description": "Present when returnPropertyQuota is true"
    },
    {
      "name": "kind",
      "type": "string"
    }
  ],
  "outputSchema": {
    "type": "object",
    "properties": {
      "dimensionHeaders": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            }
          }
        }
      },
      "metricHeaders": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "description": "The kind of value such as TYPE_INTEGER"
            }
          }
        }
      },
      "rows": {
        "type": "array",
        "description": "Absent when no row matches",
        "items": {
          "type": "object",
          "properties": {
            "dimensionValues": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string"
                  }
                }
              }
            },
            "metricValues": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "description": "A number as a string"
                  }
                }
              }
            }
          }
        }
      },
      "totals": {
        "type": "array",
        "items": {
          "type": "object"
        }
      },
      "maximums": {
        "type": "array",
        "items": {
          "type": "object"
        }
      },
      "minimums": {
        "type": "array",
        "items": {
          "type": "object"
        }
      },
      "rowCount": {
        "type": "integer"
      },
      "propertyQuota": {
        "type": "object",
        "description": "Present when returnPropertyQuota is true"
      },
      "kind": {
        "type": "string"
      }
    }
  },
  "example": {
    "file": "examples/google-analytics.reports.realtime.json",
    "json": {
      "dimensionHeaders": [
        {
          "name": "country"
        }
      ],
      "metricHeaders": [
        {
          "name": "activeUsers",
          "type": "TYPE_INTEGER"
        }
      ],
      "rows": [
        {
          "dimensionValues": [
            {
              "value": "United States"
            }
          ],
          "metricValues": [
            {
              "value": "14"
            }
          ]
        },
        {
          "dimensionValues": [
            {
              "value": "Germany"
            }
          ],
          "metricValues": [
            {
              "value": "3"
            }
          ]
        }
      ],
      "rowCount": 5,
      "kind": "analyticsData#runRealtimeReport"
    }
  },
  "commands": {
    "mode": "run",
    "cli": "telipot run google-analytics.reports.realtime \\\n  --input-json '{\"propertyId\":\"123456789\",\"metrics\":[{\"name\":\"activeUsers\"}]}'",
    "http": "curl https://api.telipot.com/v1/tasks/google-analytics.reports.realtime/run \\\n  -H \"Authorization: Bearer $TELIPOT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"propertyId\":\"123456789\",\"metrics\":[{\"name\":\"activeUsers\"}]}'",
    "quote": "telipot run google-analytics.reports.realtime \\\n  --input-json '{\"propertyId\":\"123456789\",\"metrics\":[{\"name\":\"activeUsers\"}]}' \\\n  --quote"
  },
  "siblings": []
}
