- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- AnalyticsType
- FeatureGate
- AnalyticsMetrics
- IntervalMetrics
- PredictedFailureCategoryCount
- MetricValue
- OutcomeGroupCount
- ChannelMetrics
- UpsellMetrics
- UpsellTypeMetrics
- MetricMetadata
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 |
Required. The brand to get analytics metrics for. Format: projects/{project}/locations/{location}/brands/{brand} |
Query parameters
| Parameters | |
|---|---|
timestamps[] |
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: |
storeIds[] |
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[] |
Optional. The types of analytics to compute. If empty or unspecified, all available analytics types will be computed. |
featureGate |
Optional. Feature gates. |
channelType |
Optional. The channel type to filter analytics metrics by. |
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 ( |
| Fields | |
|---|---|
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). |
FeatureGate
Feature gates to control analytics computation behavior.
| JSON representation |
|---|
{ "enableAggregationData": boolean, "enableMetricsConfig": boolean } |
| Fields | |
|---|---|
enableAggregationData |
Optional. For limited brands only. If set, compute analytics metrics using aggregation data. |
enableMetricsConfig |
Optional. If set, use the dynamic configuration-driven metrics engine. |
AnalyticsMetrics
Represents analytics metrics for a given period, with a comparison to a previous period.
| JSON representation |
|---|
{ "intervalMetrics": [ { object ( |
| Fields | |
|---|---|
intervalMetrics[] |
Metrics for the intervals. |
metricsMetadata[] |
Static display metadata for all returned metrics. |
IntervalMetrics
Represents analytics metrics for a specific time interval.
| JSON representation |
|---|
{ "interval": { object ( |
| Fields | |
|---|---|
interval |
The start / end time reflected by these metrics. |
totalOrderCount |
Output only. The total number of orders. |
successOrderCount |
Output only. The number of successful orders. |
avgOrderDurationMs |
Output only. The average order duration in ms. |
upsellSuccessRate |
Output only. Deprecated: Use |
upsellRevenue |
Output only. Deprecated: Use |
escalationCount |
Output only. The escalation outcome group count. |
predictedFailureCategoryCounts[] |
Output only. The predicted failure category counts. |
invalidOrderCount |
Output only. The total number of invalid orders. |
crewEscalationCount |
Output only. The number of crew escalation orders. |
metrics[] |
Output only. The dynamic metric values. |
outcomeGroupCounts[] |
Output only. The outcome group counts. |
totalSessionCount |
Output only. The total number of sessions. |
avgTurnCount |
Output only. The average number of conversation turns per session. |
avgAgentLatencyMs |
Output only. The average agent perceived latency in milliseconds across all turns. |
averageOrderValue |
Output only. The average order value across completed orders. |
channelMetrics[] |
Output only. Metrics broken down by channel. |
totalOrderValue |
Output only. The total order value across completed orders. |
upsellRate |
Output only. Deprecated: Use |
avgOrderValue |
Output only. The average order value across completed orders. |
upsellMetrics |
Output only. Consolidated upsell performance metrics for this interval. |
PredictedFailureCategoryCount
Predicted failure category count.
| JSON representation |
|---|
{ "category": string, "count": string } |
| Fields | |
|---|---|
category |
Output only. The predicted failure category. |
count |
Output only. The count of sessions in this category. |
MetricValue
Represents a single dynamic metric value.
| JSON representation |
|---|
{ "metricId": string, "value": number, "previousValue": number } |
| Fields | |
|---|---|
metricId |
Unique system identifier (e.g. "automation_rate"). |
value |
Calculated value for the metric. |
previousValue |
Value of this metric in the previous comparison period. |
OutcomeGroupCount
Outcome group count.
| JSON representation |
|---|
{ "outcomeGroup": string, "count": string } |
| Fields | |
|---|---|
outcomeGroup |
Output only. The outcome group label. |
count |
Output only. The count of sessions in this outcome group. |
ChannelMetrics
Metrics broken down by channel.
| JSON representation |
|---|
{ "channel": string, "totalSessionCount": string } |
| Fields | |
|---|---|
channel |
Output only. The ordering channel (e.g. "Phone, Mobile, Drive-thru"). |
totalSessionCount |
Output only. The total number of sessions for this channel. |
UpsellMetrics
Represents upsell performance metrics for an interval.
| JSON representation |
|---|
{ "upsellRate": number, "upsellSuccessRate": number, "upsellRevenue": { object ( |
| Fields | |
|---|---|
upsellRate |
Output only. Percentage of total orders containing at least one upsell item. |
upsellSuccessRate |
Output only. Upsell conversion rate (percentage of upsell suggestions accepted). |
upsellRevenue |
Output only. Incremental revenue lift generated from accepted upsells. |
totalAttemptCount |
Output only. Total upsell attempts across all types. |
totalAcceptedCount |
Output only. Total accepted upsells across all types. |
typeMetrics[] |
Output only. The upsell metrics broken down by upsell type. |
UpsellTypeMetrics
Upsell metrics broken down by type.
| JSON representation |
|---|
{ "upsellType": string, "attemptCount": string, "acceptedCount": string, "upsellSuccessRate": number } |
| Fields | |
|---|---|
upsellType |
Output only. The upsell type (e.g. "SUGGESTIVE_UPSELL", "COMBO_UP_SIZE"). |
attemptCount |
Output only. The number of times this upsell type was attempted. |
acceptedCount |
Output only. The number of times this upsell type was accepted. |
upsellSuccessRate |
Output only. Conversion rate for this specific type (acceptedCount / attemptCount * 100). |
MetricMetadata
Represents analytics metrics for a specific time interval. Represents the display metadata for a metric.
| JSON representation |
|---|
{ "metricId": string, "displayName": string, "description": string, "unit": string, "displayGroup": string, "displayOrder": integer, "targetThreshold": number } |
| Fields | |
|---|---|
metricId |
e.g. "automation_rate", must be unique across metrics |
displayName |
User-friendly display name. |
description |
Description of what the metric calculates. |
unit |
Display unit (e.g. "%", "$", "s", "count"). |
displayGroup |
Group name for categorization in UI. |
displayOrder |
Display order order in dashboards. |
targetThreshold |
The target performance threshold. |