Method: accounts.locations.reportInsights

Returns a report containing insights on one or more metrics by location.

HTTP request

POST https://mybusiness.googleapis.com/v4/{name=accounts/*}/locations:reportInsights

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

The account resource name.

Request body

The request body contains data with the following structure:

JSON representation
{
  "locationNames": [
    string
  ],
  "basicRequest": {
    object(BasicMetricsRequest)
  },
  "drivingDirectionsRequest": {
    object(DrivingDirectionMetricsRequest)
  }
}
Fields
locationNames[]

string

A collection of locations to fetch insights for, specified by their names.

basicRequest

object(BasicMetricsRequest)

A request to include basic metric insights in the report.

drivingDirectionsRequest

object(DrivingDirectionMetricsRequest)

A request to include insights about driving-direction requests in the report.

Response body

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

Response message for Insights.ReportLocationInsights.

JSON representation
{
  "locationMetrics": [
    {
      object(LocationMetrics)
    }
  ],
  "locationDrivingDirectionMetrics": [
    {
      object(LocationDrivingDirectionMetrics)
    }
  ]
}
Fields
locationMetrics[]

object(LocationMetrics)

A collection of metric values by location.

locationDrivingDirectionMetrics[]

object(LocationDrivingDirectionMetrics)

A collection of values for driving direction-related metrics.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/plus.business.manage

For more information, see the OAuth 2.0 Overview.

DrivingDirectionMetricsRequest

A request for driving direction insights.

JSON representation
{
  "numDays": enum(NumDays),
  "languageCode": string
}
Fields
numDays

enum(NumDays)

The number of days to aggregate data for. Results returned will be available data over the last number of requested days. Valid values are 7, 30, and 90.

languageCode

string

The BCP 47 code for the language. If a language code is not provided, it defaults to English.

NumDays

Number of days that this request can support.

Enums
SEVEN 7 days. This is the default value.
THIRTY 30 days.
NINETY 90 days.

LocationMetrics

A series of Metrics and BreakdownMetrics associated with a Location over some time range.

JSON representation
{
  "locationName": string,
  "timeZone": string,
  "metricValues": [
    {
      object(MetricValue)
    }
  ]
}
Fields
locationName

string

The location resource name these values belong to.

timeZone

string

IANA timezone for the location.

metricValues[]

object(MetricValue)

A list of values for the requested metrics.

LocationDrivingDirectionMetrics

A location indexed with the regions that people usually come from. This is captured by counting how many driving-direction requests to this location are from each region.

JSON representation
{
  "locationName": string,
  "topDirectionSources": [
    {
      object(TopDirectionSources)
    }
  ],
  "timeZone": string
}
Fields
locationName

string

The location resource name this metric value belongs to.

topDirectionSources[]

object(TopDirectionSources)

Driving-direction requests by source region. By convention, these are sorted by count with at most 10 results.

timeZone

string

Time zone (IANA timezone IDs, for example, 'Europe/London') of the location.

TopDirectionSources

Top regions where driving-direction requests originated from.

JSON representation
{
  "dayCount": number,
  "regionCounts": [
    {
      object(RegionCount)
    }
  ]
}
Fields
dayCount

number

The number of days data is aggregated over.

regionCounts[]

object(RegionCount)

Regions sorted in descending order by count.

RegionCount

A region with its associated request count.

JSON representation
{
  "latlng": {
    object(LatLng)
  },
  "label": string,
  "count": string
}
Fields
latlng

object(LatLng)

Center of region.

label

string

Human-readable label for the region.

count

string (int64 format)

Number of driving-direction requests from this region.

Send feedback about...

Google My Business API
Google My Business API
Need help? Visit our support page.