Close httplib2 connections.
search(merchantId, body=None, x__xgafv=None)
Retrieves merchant performance mertrics matching the search query and optionally segmented by selected dimensions.
search_next(previous_request, previous_response)
Retrieves the next page of results.
close()
Close httplib2 connections.
search(merchantId, body=None, x__xgafv=None)
Retrieves merchant performance mertrics matching the search query and optionally segmented by selected dimensions. Args: merchantId: string, Required. Id of the merchant making the call. Must be a standalone account or an MCA subaccount. (required) body: object, The request body. The object takes the form of: { # Request message for the ReportService.Search method. "pageSize": 42, # Number of ReportRows to retrieve in a single page. Defaults to the maximum of 1000. Values above 1000 are coerced to 1000. "pageToken": "A String", # Token of the page to retrieve. If not specified, the first page of results is returned. In order to request the next page of results, the value obtained from `next_page_token` in the previous response should be used. "query": "A String", # Required. Query that defines performance metrics to retrieve and dimensions according to which the metrics are to be segmented. For details on how to construct your query, see the [Query Language guide](https://developers.google.com/shopping-content/guides/reports/query-language/overview). } x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Response message for the ReportService.Search method. "nextPageToken": "A String", # Token which can be sent as `page_token` to retrieve the next page. If omitted, there are no subsequent pages. "results": [ # Rows that matched the search query. { # Result row returned from the search query. "metrics": { # Performance metrics. Values are only set for metrics requested explicitly in the request's search query. # Metrics requested by the merchant in the query. Metric values are only set for metrics requested explicitly in the query. "aos": 3.14, # Average order size - the average number of items in an order. **This metric cannot be segmented by product dimensions.** "aovMicros": 3.14, # Average order value - the average value (total price of items) of all placed orders. The currency of the returned value is stored in the currency_code segment. If this metric is selected, 'segments.currency_code' is automatically added to the SELECT clause in the search query (unless it is explicitly selected by the user) and the currency_code segment is populated in the response. **This metric cannot be segmented by product dimensions.** "clicks": "A String", # Number of clicks. "ctr": 3.14, # Click-through rate - the number of clicks merchant's products receive (clicks) divided by the number of times the products are shown (impressions). "daysToShip": 3.14, # Average number of days between an order being placed and the order being fully shipped, reported on the last shipment date. **This metric cannot be segmented by product dimensions.** "impressions": "A String", # Number of times merchant's products are shown. "itemDaysToShip": 3.14, # Average number of days between an item being ordered and the item being "itemFillRate": 3.14, # Percentage of shipped items in relation to all finalized items (shipped or rejected by the merchant; unshipped items are not taken into account), reported on the order date. Item fill rate is lowered by merchant rejections. "orderedItemSalesMicros": "A String", # Total price of ordered items. Excludes shipping, taxes (US only), and customer cancellations that happened within 30 minutes of placing the order. The currency of the returned value is stored in the currency_code segment. If this metric is selected, 'segments.currency_code' is automatically added to the SELECT clause in the search query (unless it is explicitly selected by the user) and the currency_code segment is populated in the response. "orderedItems": "A String", # Number of ordered items. Excludes customer cancellations that happened within 30 minutes of placing the order. "orders": "A String", # Number of placed orders. Excludes customer cancellations that happened within 30 minutes of placing the order. **This metric cannot be segmented by product dimensions.** "rejectedItems": "A String", # Number of ordered items canceled by the merchant, reported on the order date. "returnRate": 3.14, # Total price of returned items divided by the total price of shipped items, reported on the order date. If this metric is selected, 'segments.currency_code' is automatically added to the SELECT clause in the search query (unless it is explicitly selected by the user) and the currency_code segment is populated in the response. "returnedItems": "A String", # Number of ordered items sent back for return, reported on the date when the merchant accepted the return. "returnsMicros": "A String", # Total price of ordered items sent back for return, reported on the date when the merchant accepted the return. The currency of the returned value is stored in the currency_code segment. If this metric is selected, 'segments.currency_code' is automatically added to the SELECT clause in the search query (unless it is explicitly selected by the user) and the currency_code segment is populated in the response. "shippedItemSalesMicros": "A String", # Total price of shipped items, reported on the order date. Excludes shipping and taxes (US only). The currency of the returned value is stored in the currency_code segment. If this metric is selected, 'segments.currency_code' is automatically added to the SELECT clause in the search query (unless it is explicitly selected by the user) and the currency_code segment is populated in the response. "shippedItems": "A String", # Number of shipped items, reported on the shipment date. "shippedOrders": "A String", # Number of fully shipped orders, reported on the last shipment date. **This metric cannot be segmented by product dimensions.** "unshippedItems": 3.14, # Number of ordered items not shipped up until the end of the queried day. If a multi-day period is specified in the search query, the returned value is the average number of unshipped items over the days in the queried period. "unshippedOrders": 3.14, # Number of orders not shipped or partially shipped up until the end of the queried day. If a multi-day period is specified in the search query, the returned value is the average number of unshipped orders over the days in the queried period. **This metric cannot be segmented by product dimensions.** }, "segments": { # Dimensions according to which metrics are segmented in the response. Values of product dimensions, e.g., offer id, reflect the state of a product at the time of the corresponding event, e.g., impression or order. Segment fields cannot be selected in queries without also selecting at least one metric field. Values are only set for dimensions requested explicitly in the request's search query. # Segmentation dimensions requested by the merchant in the query. Dimension values are only set for dimensions requested explicitly in the query. "brand": "A String", # Brand of the product. "categoryL1": "A String", # [Product category (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. "categoryL2": "A String", # [Product category (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. "categoryL3": "A String", # [Product category (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. "categoryL4": "A String", # [Product category (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. "categoryL5": "A String", # [Product category (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. "currencyCode": "A String", # Currency in which price metrics are represented, e.g., if you select `ordered_item_sales_micros`, the returned value will be represented by this currency. "customLabel0": "A String", # Custom label 0 for custom grouping of products. "customLabel1": "A String", # Custom label 1 for custom grouping of products. "customLabel2": "A String", # Custom label 2 for custom grouping of products. "customLabel3": "A String", # Custom label 3 for custom grouping of products. "customLabel4": "A String", # Custom label 4 for custom grouping of products. "date": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. # Date in the merchant timezone to which metrics apply. "day": 42, # 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. "month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. "year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. }, "offerId": "A String", # Merchant-provided id of the product. "productTypeL1": "A String", # [Product type (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. "productTypeL2": "A String", # [Product type (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. "productTypeL3": "A String", # [Product type (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. "productTypeL4": "A String", # [Product type (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. "productTypeL5": "A String", # [Product type (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. "program": "A String", # Program to which metrics apply, e.g., Free Product Listing. "title": "A String", # Title of the product. "week": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. # First day of the week (Monday) of the metrics date in the merchant timezone. "day": 42, # 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. "month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. "year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. }, }, }, ], }
search_next(previous_request, previous_response)
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.