Class: Google::Apis::BusinessprofileperformanceV1::BusinessProfilePerformanceService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::BusinessprofileperformanceV1::BusinessProfilePerformanceService
- Defined in:
- lib/google/apis/businessprofileperformance_v1/service.rb
Overview
Business Profile Performance API
The Business Profile Performance API allows merchants to fetch performance reports about their business profile on Google. Note - If you have a quota of 0 after enabling the API, please request for GBP API access.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://businessprofileperformance.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#fetch_location_multi_daily_metrics_time_series(location, daily_metrics: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::FetchMultiDailyMetricsTimeSeriesResponse
Returns the values for each date from a given time range and optionally the sub entity type, where applicable, that are associated with the specific daily metrics.
-
#get_location_daily_metrics_time_series(name, daily_metric: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, daily_sub_entity_type_day_of_week: nil, daily_sub_entity_type_time_of_day_hours: nil, daily_sub_entity_type_time_of_day_minutes: nil, daily_sub_entity_type_time_of_day_nanos: nil, daily_sub_entity_type_time_of_day_seconds: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::GetDailyMetricsTimeSeriesResponse
Returns the values for each date from a given time range that are associated with the specific daily metric.
-
#initialize ⇒ BusinessProfilePerformanceService
constructor
A new instance of BusinessProfilePerformanceService.
-
#list_location_searchkeyword_impression_monthlies(parent, monthly_range_end_month_day: nil, monthly_range_end_month_month: nil, monthly_range_end_month_year: nil, monthly_range_start_month_day: nil, monthly_range_start_month_month: nil, monthly_range_start_month_year: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::ListSearchKeywordImpressionsMonthlyResponse
Returns the search keywords used to find a business in search or maps.
Constructor Details
#initialize ⇒ BusinessProfilePerformanceService
Returns a new instance of BusinessProfilePerformanceService.
49 50 51 52 53 54 |
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 49 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-businessprofileperformance_v1', client_version: Google::Apis::BusinessprofileperformanceV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
42 43 44 |
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 42 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
47 48 49 |
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 47 def quota_user @quota_user end |
Instance Method Details
#fetch_location_multi_daily_metrics_time_series(location, daily_metrics: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::FetchMultiDailyMetricsTimeSeriesResponse
Returns the values for each date from a given time range and optionally the
sub entity type, where applicable, that are associated with the specific daily
metrics. Example request: GET https://businessprofileperformance.googleapis.
com/v1/locations/12345:fetchMultiDailyMetricsTimeSeries?dailyMetrics=
WEBSITE_CLICKS&dailyMetrics=CALL_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
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 103 def fetch_location_multi_daily_metrics_time_series(location, daily_metrics: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+location}:fetchMultiDailyMetricsTimeSeries', ) command.response_representation = Google::Apis::BusinessprofileperformanceV1::FetchMultiDailyMetricsTimeSeriesResponse::Representation command.response_class = Google::Apis::BusinessprofileperformanceV1::FetchMultiDailyMetricsTimeSeriesResponse command.params['location'] = location unless location.nil? command.query['dailyMetrics'] = daily_metrics unless daily_metrics.nil? command.query['dailyRange.endDate.day'] = daily_range_end_date_day unless daily_range_end_date_day.nil? command.query['dailyRange.endDate.month'] = daily_range_end_date_month unless daily_range_end_date_month.nil? command.query['dailyRange.endDate.year'] = daily_range_end_date_year unless daily_range_end_date_year.nil? command.query['dailyRange.startDate.day'] = daily_range_start_date_day unless daily_range_start_date_day.nil? command.query['dailyRange.startDate.month'] = daily_range_start_date_month unless daily_range_start_date_month.nil? command.query['dailyRange.startDate.year'] = daily_range_start_date_year unless daily_range_start_date_year.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_location_daily_metrics_time_series(name, daily_metric: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, daily_sub_entity_type_day_of_week: nil, daily_sub_entity_type_time_of_day_hours: nil, daily_sub_entity_type_time_of_day_minutes: nil, daily_sub_entity_type_time_of_day_nanos: nil, daily_sub_entity_type_time_of_day_seconds: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::GetDailyMetricsTimeSeriesResponse
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
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 184 def get_location_daily_metrics_time_series(name, daily_metric: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, daily_sub_entity_type_day_of_week: nil, daily_sub_entity_type_time_of_day_hours: nil, daily_sub_entity_type_time_of_day_minutes: nil, daily_sub_entity_type_time_of_day_nanos: nil, daily_sub_entity_type_time_of_day_seconds: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}:getDailyMetricsTimeSeries', ) command.response_representation = Google::Apis::BusinessprofileperformanceV1::GetDailyMetricsTimeSeriesResponse::Representation command.response_class = Google::Apis::BusinessprofileperformanceV1::GetDailyMetricsTimeSeriesResponse command.params['name'] = name unless name.nil? command.query['dailyMetric'] = daily_metric unless daily_metric.nil? command.query['dailyRange.endDate.day'] = daily_range_end_date_day unless daily_range_end_date_day.nil? command.query['dailyRange.endDate.month'] = daily_range_end_date_month unless daily_range_end_date_month.nil? command.query['dailyRange.endDate.year'] = daily_range_end_date_year unless daily_range_end_date_year.nil? command.query['dailyRange.startDate.day'] = daily_range_start_date_day unless daily_range_start_date_day.nil? command.query['dailyRange.startDate.month'] = daily_range_start_date_month unless daily_range_start_date_month.nil? command.query['dailyRange.startDate.year'] = daily_range_start_date_year unless daily_range_start_date_year.nil? command.query['dailySubEntityType.dayOfWeek'] = daily_sub_entity_type_day_of_week unless daily_sub_entity_type_day_of_week.nil? command.query['dailySubEntityType.timeOfDay.hours'] = daily_sub_entity_type_time_of_day_hours unless daily_sub_entity_type_time_of_day_hours.nil? command.query['dailySubEntityType.timeOfDay.minutes'] = daily_sub_entity_type_time_of_day_minutes unless daily_sub_entity_type_time_of_day_minutes.nil? command.query['dailySubEntityType.timeOfDay.nanos'] = daily_sub_entity_type_time_of_day_nanos unless daily_sub_entity_type_time_of_day_nanos.nil? command.query['dailySubEntityType.timeOfDay.seconds'] = daily_sub_entity_type_time_of_day_seconds unless daily_sub_entity_type_time_of_day_seconds.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_location_searchkeyword_impression_monthlies(parent, monthly_range_end_month_day: nil, monthly_range_end_month_month: nil, monthly_range_end_month_year: nil, monthly_range_start_month_day: nil, monthly_range_start_month_month: nil, monthly_range_start_month_year: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::ListSearchKeywordImpressionsMonthlyResponse
Returns the search keywords used to find a business in search or maps. Each
search keyword is accompanied by impressions which are aggregated on a monthly
basis. Example request: GET https://businessprofileperformance.googleapis.com/
v1/locations/12345/searchkeywords/impressions/monthly?monthly_range.
start_month.year=2022&monthly_range.start_month.month=1&monthly_range.
end_month.year=2022&monthly_range.end_month.month=3
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 255 def list_location_searchkeyword_impression_monthlies(parent, monthly_range_end_month_day: nil, monthly_range_end_month_month: nil, monthly_range_end_month_year: nil, monthly_range_start_month_day: nil, monthly_range_start_month_month: nil, monthly_range_start_month_year: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/searchkeywords/impressions/monthly', ) command.response_representation = Google::Apis::BusinessprofileperformanceV1::ListSearchKeywordImpressionsMonthlyResponse::Representation command.response_class = Google::Apis::BusinessprofileperformanceV1::ListSearchKeywordImpressionsMonthlyResponse command.params['parent'] = parent unless parent.nil? command.query['monthlyRange.endMonth.day'] = monthly_range_end_month_day unless monthly_range_end_month_day.nil? command.query['monthlyRange.endMonth.month'] = monthly_range_end_month_month unless monthly_range_end_month_month.nil? command.query['monthlyRange.endMonth.year'] = monthly_range_end_month_year unless monthly_range_end_month_year.nil? command.query['monthlyRange.startMonth.day'] = monthly_range_start_month_day unless monthly_range_start_month_day.nil? command.query['monthlyRange.startMonth.month'] = monthly_range_start_month_month unless monthly_range_start_month_month.nil? command.query['monthlyRange.startMonth.year'] = monthly_range_start_month_year unless monthly_range_start_month_year.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |