Method: projects.locations.brands.computeAnalyticsMetrics

Computes analytics metrics for a given brand for specified time period with optional store filter.

HTTP request

GET https://foodorderingaiagent.googleapis.com/v1/{brand=projects/*/locations/*/brands/*}:computeAnalyticsMetrics

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
brand

string

Required. The brand to get analytics metrics for. Format: projects/{project}/locations/{location}/brands/{brand}

Query parameters

Parameters
timestamps[]

string (Timestamp format)

Required. The timestamps that mark the start of each interval for which analytics metrics are calculated.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

storeIds[]

string

Optional. The list of store IDs to get analytics metrics for. If not specified, analytics metrics for all stores will be returned. Needed to query by city or state.

analyticsTypes[]

enum (AnalyticsType)

Optional. The types of analytics to compute. If empty or unspecified, all available analytics types will be computed.

Request body

The request body must be empty.

Response body

Response message for MenuService.ComputeAnalyticsMetrics.

If successful, the response body contains data with the following structure:

JSON representation
{
  "analyticsMetrics": {
    object (AnalyticsMetrics)
  }
}
Fields
analyticsMetrics

object (AnalyticsMetrics)

Output only. The analytics metrics for the brand.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

AnalyticsType

The type of analytics to compute.

Enums
ANALYTICS_TYPE_UNSPECIFIED Unspecified analytics type.
GENERIC Compute generic/overall metrics (e.g., order count, escalation count, upsell count).
DAILY Compute daily metrics (e.g., daily order and escalation counts).
PREDICTED_FAILURE_CATEGORIES Compute predicted failure category metrics (e.g., predicted failure category count).

AnalyticsMetrics

Represents analytics metrics for a given period, with a comparison to a previous period.

JSON representation
{
  "intervalMetrics": [
    {
      object (IntervalMetrics)
    }
  ]
}
Fields
intervalMetrics[]

object (IntervalMetrics)

Metrics for the intervals.

IntervalMetrics

Represents analytics metrics for a specific time interval.

JSON representation
{
  "interval": {
    object (Interval)
  },
  "totalOrderCount": string,
  "successOrderCount": string,
  "avgOrderDurationMs": string,
  "upsellSuccessRate": number,
  "upsellRevenue": {
    object (Money)
  },
  "escalationCount": string,
  "predictedFailureCategoryCounts": [
    {
      object (PredictedFailureCategoryCount)
    }
  ],
  "invalidOrderCount": string,
  "crewEscalationCount": string
}
Fields
interval

object (Interval)

The start / end time reflected by these metrics.

totalOrderCount

string (int64 format)

Output only. The total number of orders.

successOrderCount

string (int64 format)

Output only. The number of successful orders.

avgOrderDurationMs

string (int64 format)

Output only. The average order duration in ms.

upsellSuccessRate

number

Output only. The upsell success rate.

upsellRevenue

object (Money)

Output only. The upsell revenue.

escalationCount

string (int64 format)

Output only. The escalation outcome group count.

predictedFailureCategoryCounts[]

object (PredictedFailureCategoryCount)

Output only. The predicted failure category counts.

invalidOrderCount

string (int64 format)

Output only. The total number of invalid orders.

crewEscalationCount

string (int64 format)

Output only. The number of crew escalation orders.

PredictedFailureCategoryCount

Predicted failure category count.

JSON representation
{
  "category": string,
  "count": string
}
Fields
category

string

Output only. The predicted failure category.

count

string (int64 format)

Output only. The count of sessions in this category.