getDailyMetricsTimeSeries method

Future<GetDailyMetricsTimeSeriesResponse> getDailyMetricsTimeSeries(
  1. String name, {
  2. String? dailyMetric,
  3. int? dailyRange_endDate_day,
  4. int? dailyRange_endDate_month,
  5. int? dailyRange_endDate_year,
  6. int? dailyRange_startDate_day,
  7. int? dailyRange_startDate_month,
  8. int? dailyRange_startDate_year,
  9. String? dailySubEntityType_dayOfWeek,
  10. int? dailySubEntityType_timeOfDay_hours,
  11. int? dailySubEntityType_timeOfDay_minutes,
  12. int? dailySubEntityType_timeOfDay_nanos,
  13. int? dailySubEntityType_timeOfDay_seconds,
  14. String? $fields,
})

Returns the values for each date from a given time range that are associated with the specific daily metric.

Example request: GET https://businessprofileperformance.googleapis.com/v1/locations/12345:getDailyMetricsTimeSeries?dailyMetric=WEBSITE_CLICKS&daily_range.start_date.year=2022&daily_range.start_date.month=1&daily_range.start_date.day=1&daily_range.end_date.year=2022&daily_range.end_date.month=3&daily_range.end_date.day=31

Request parameters:

name - Required. The location for which the time series should be fetched. Format: locations/{location_id} where location_id is an unobfuscated listing id. Value must have pattern ^locations/\[^/\]+$.

dailyMetric - Required. The metric to retrieve time series. Possible string values are:

  • "DAILY_METRIC_UNKNOWN" : Represents the default unknown value.
  • "BUSINESS_IMPRESSIONS_DESKTOP_MAPS" : Business impressions on Google Maps on Desktop devices. Multiple impressions by a unique user within a single day are counted as a single impression.
  • "BUSINESS_IMPRESSIONS_DESKTOP_SEARCH" : Business impressions on Google Search on Desktop devices. Multiple impressions by a unique user within a single day are counted as a single impression.
  • "BUSINESS_IMPRESSIONS_MOBILE_MAPS" : Business impressions on Google Maps on Mobile devices. Multiple impressions by a unique user within a single day are counted as a single impression.
  • "BUSINESS_IMPRESSIONS_MOBILE_SEARCH" : Business impressions on Google Search on Mobile devices. Multiple impressions by a unique user within a single day are counted as a single impression.
  • "BUSINESS_CONVERSATIONS" : The number of message conversations received on the business profile.
  • "BUSINESS_DIRECTION_REQUESTS" : The number of times a direction request was requested to the business location.
  • "CALL_CLICKS" : The number of times the business profile call button was clicked.
  • "WEBSITE_CLICKS" : The number of times the business profile website was clicked.
  • "BUSINESS_BOOKINGS" : The number of bookings made from the business profile via Reserve with Google.
  • "BUSINESS_FOOD_ORDERS" : The number of food orders received from the business profile.
  • "BUSINESS_FOOD_MENU_CLICKS" : The number of clicks to view or interact with the menu content on the business profile. Multiple clicks by a unique user within a single day are counted as 1.

dailyRange_endDate_day - Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

dailyRange_endDate_month - Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

dailyRange_endDate_year - Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

dailyRange_startDate_day - Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

dailyRange_startDate_month - Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

dailyRange_startDate_year - Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

dailySubEntityType_dayOfWeek - Represents the day of the week. Eg: MONDAY. Currently supported DailyMetrics = NONE. Possible string values are:

  • "DAY_OF_WEEK_UNSPECIFIED" : The day of the week is unspecified.
  • "MONDAY" : Monday
  • "TUESDAY" : Tuesday
  • "WEDNESDAY" : Wednesday
  • "THURSDAY" : Thursday
  • "FRIDAY" : Friday
  • "SATURDAY" : Saturday
  • "SUNDAY" : Sunday

dailySubEntityType_timeOfDay_hours - Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

dailySubEntityType_timeOfDay_minutes - Minutes of hour of day. Must be from 0 to 59.

dailySubEntityType_timeOfDay_nanos - Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

dailySubEntityType_timeOfDay_seconds - Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GetDailyMetricsTimeSeriesResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GetDailyMetricsTimeSeriesResponse> getDailyMetricsTimeSeries(
  core.String name, {
  core.String? dailyMetric,
  core.int? dailyRange_endDate_day,
  core.int? dailyRange_endDate_month,
  core.int? dailyRange_endDate_year,
  core.int? dailyRange_startDate_day,
  core.int? dailyRange_startDate_month,
  core.int? dailyRange_startDate_year,
  core.String? dailySubEntityType_dayOfWeek,
  core.int? dailySubEntityType_timeOfDay_hours,
  core.int? dailySubEntityType_timeOfDay_minutes,
  core.int? dailySubEntityType_timeOfDay_nanos,
  core.int? dailySubEntityType_timeOfDay_seconds,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (dailyMetric != null) 'dailyMetric': [dailyMetric],
    if (dailyRange_endDate_day != null)
      'dailyRange.endDate.day': ['${dailyRange_endDate_day}'],
    if (dailyRange_endDate_month != null)
      'dailyRange.endDate.month': ['${dailyRange_endDate_month}'],
    if (dailyRange_endDate_year != null)
      'dailyRange.endDate.year': ['${dailyRange_endDate_year}'],
    if (dailyRange_startDate_day != null)
      'dailyRange.startDate.day': ['${dailyRange_startDate_day}'],
    if (dailyRange_startDate_month != null)
      'dailyRange.startDate.month': ['${dailyRange_startDate_month}'],
    if (dailyRange_startDate_year != null)
      'dailyRange.startDate.year': ['${dailyRange_startDate_year}'],
    if (dailySubEntityType_dayOfWeek != null)
      'dailySubEntityType.dayOfWeek': [dailySubEntityType_dayOfWeek],
    if (dailySubEntityType_timeOfDay_hours != null)
      'dailySubEntityType.timeOfDay.hours': [
        '${dailySubEntityType_timeOfDay_hours}'
      ],
    if (dailySubEntityType_timeOfDay_minutes != null)
      'dailySubEntityType.timeOfDay.minutes': [
        '${dailySubEntityType_timeOfDay_minutes}'
      ],
    if (dailySubEntityType_timeOfDay_nanos != null)
      'dailySubEntityType.timeOfDay.nanos': [
        '${dailySubEntityType_timeOfDay_nanos}'
      ],
    if (dailySubEntityType_timeOfDay_seconds != null)
      'dailySubEntityType.timeOfDay.seconds': [
        '${dailySubEntityType_timeOfDay_seconds}'
      ],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' + core.Uri.encodeFull('$name') + ':getDailyMetricsTimeSeries';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return GetDailyMetricsTimeSeriesResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}