Module: Peddler::Reports::SellingPartnerSearchQueryPerformance

Defined in:
lib/peddler/reports/selling_partner_search_query_performance.rb,
lib/peddler/reports/selling_partner_search_query_performance/report.rb,
lib/peddler/reports/selling_partner_search_query_performance/report_options.rb,
lib/peddler/reports/selling_partner_search_query_performance/search_query_data.rb,
lib/peddler/reports/selling_partner_search_query_performance/report_specification.rb,
lib/peddler/reports/selling_partner_search_query_performance/search_query_performance_data.rb,
lib/peddler/reports/selling_partner_search_query_performance/search_query_performance_click_data.rb,
lib/peddler/reports/selling_partner_search_query_performance/search_query_performance_cart_add_data.rb,
lib/peddler/reports/selling_partner_search_query_performance/search_query_performance_purchase_data.rb,
lib/peddler/reports/selling_partner_search_query_performance/search_query_performance_impression_data.rb

Overview

The Search Query Performance Report provides overall query performance, such as impressions, clicks, cart adds, and purchases for a list of Amazon Standard Identification Numbers (ASINs) and date range that you specify. Data is available at different reporting periods: WEEK, MONTH, and QUARTER. Requests cannot span multiple periods. For example, a request at the WEEK level cannot start on 2025-01-05 and end on 2025-01-18 as this request spans two weeks.

Constant Summary collapse

Report =

The Search Query Performance Report provides overall query performance, such as impressions, clicks, cart adds, and purchases for a list of Amazon Standard Identification Numbers (ASINs) and date range that you specify. Data is available at different reporting periods: WEEK, MONTH, and QUARTER. Requests cannot span multiple periods. For example, a request at the WEEK level cannot start on 2025-01-05 and end on 2025-01-18 as this request spans two weeks.

Structure.new do
  # @return [Array<SearchQueryPerformanceData>]
  attribute(:data_by_asin, [SearchQueryPerformanceData], from: "dataByAsin")

  # @return [Hash] Summarizes the original report request.
  attribute(:report_specification, ReportSpecification, from: "reportSpecification")
end
ReportOptions =

The report options that specify parameters, such as reportPeriod and asin.

Structure.new do
  # @return [String] A space-separated list of ASINs for which you can request the report. There is a
  # 200-character limit.
  attribute(:asin, String)

  # @return [String] The granularity of the data in the report. Valid values are WEEK, MONTH, and QUARTER.
  attribute(:report_period, String, from: "reportPeriod")
end
SearchQueryData =

The search query data.

Structure.new do
  # @return [String] A buying customer’s search query that is relevant to your branded catalog.
  attribute(:search_query, String, from: "searchQuery")

  # @return [Integer] The rank for a search query in comparison to other queries for the ASIN. The ranking
  # mechanism measures overall performance (the highest rank is 1).
  attribute(:search_query_score, Integer, from: "searchQueryScore")

  # @return [Integer] The number of times customers search for a query at a select time period.
  attribute(:search_query_volume, Integer, from: "searchQueryVolume")
end
ReportSpecification =

Summarizes the original report request.

Structure.new do
  # @return [Date] The end date of the report (Amazon ignores the time component). For WEEK, MONTH, and QUARTER
  # reportPeriods, this value must correspond to the last day in the reportPeriod that you specify or else a fatal
  # error returns. For example, dataEndTime must be a Saturday for the WEEK reportPeriod.
  attribute(:data_end_time, Date, from: "dataEndTime")

  # @return [Date] The start date of the report (Amazon ignores the time component). For WEEK, MONTH, and QUARTER
  # reportPeriods, this value must correspond to the first day in the reportPeriod that you specify or else a
  # fatal error returns. For example, dataStartTime must be a Sunday for the WEEK reportPeriod.
  attribute(:data_start_time, Date, from: "dataStartTime")

  # @return [Array<String>] This parameter must match the marketplaceId of the selling partner account. This
  # report type supports only one marketplaceId per report. If you specify multiple marketplaces, a fatal error
  # returns and report generation fails.
  attribute(:marketplace_ids, [String], from: "marketplaceIds")

  # @return [ReportOptions] The report options that specify parameters, such as reportPeriod and asin.
  attribute(:report_options, ReportOptions, from: "reportOptions")

  # @return [String] The type of the report.
  attribute(:report_type, String, from: "reportType")
end
SearchQueryPerformanceData =

Contains search query performance data at the ASIN level.

Structure.new do
  # @return [String] A space-separated list of ASINs for which you can request the report. There is a
  # 200-character limit.
  attribute(:asin, String)

  # @return [SearchQueryPerformanceCartAddData]
  attribute(:cart_add_data, SearchQueryPerformanceCartAddData, from: "cartAddData")

  # @return [SearchQueryPerformanceClickData]
  attribute(:click_data, SearchQueryPerformanceClickData, from: "clickData")

  # @return [Date] The end date of the data for the ASIN that you specify.
  attribute(:end_date, Date, from: "endDate")

  # @return [SearchQueryPerformanceImpressionData]
  attribute(:impression_data, SearchQueryPerformanceImpressionData, from: "impressionData")

  # @return [SearchQueryPerformancePurchaseData]
  attribute(:purchase_data, SearchQueryPerformancePurchaseData, from: "purchaseData")

  # @return [SearchQueryData]
  attribute(:search_query_data, SearchQueryData, from: "searchQueryData")

  # @return [Date] The start date of the data for the ASIN that you specify.
  attribute(:start_date, Date, from: "startDate")
end
SearchQueryPerformanceClickData =

The search query performance click data.

Structure.new do
  # @return [Integer] For a search query, the number of clicks for the current ASIN.
  attribute(:asin_click_count, Integer, from: "asinClickCount")

  # @return [Float] The fraction of clicks for the current ASIN in comparison to the total click count for the
  # query.
  attribute(:asin_click_share, Float, from: "asinClickShare")

  # @return [Money]
  attribute(:asin_median_click_price, Money, from: "asinMedianClickPrice")

  # @return [Integer] For a search query, the number of ASIN clicks that originate from the search results page
  # for any ASIN.
  attribute(:total_click_count, Integer, from: "totalClickCount")

  # @return [Float] For a search query, the number of clicks divided by the search query volume.
  attribute(:total_click_rate, Float, from: "totalClickRate")

  # @return [Money]
  attribute(:total_median_click_price, Money, from: "totalMedianClickPrice")

  # @return [Integer] The number of times customers click on any ASIN with the one-day delivery message from the
  # search results page for the specific query.
  attribute(:total_one_day_shipping_click_count, Integer, from: "totalOneDayShippingClickCount")

  # @return [Integer] The number of times customers click on any ASIN with the same-day delivery message from the
  # search results page for the specific query.
  attribute(:total_same_day_shipping_click_count, Integer, from: "totalSameDayShippingClickCount")

  # @return [Integer] The number of times customers click on any ASIN with the two-day delivery message from the
  # search results page for the specific query.
  attribute(:total_two_day_shipping_click_count, Integer, from: "totalTwoDayShippingClickCount")
end
SearchQueryPerformanceCartAddData =

The search query performance cart add data.

Structure.new do
  # @return [Integer] For a search query, the number of cart-adds for the ASIN that originates from the search
  # results page.
  attribute(:asin_cart_add_count, Integer, from: "asinCartAddCount")

  # @return [Float] The fraction of cart-adds for the ASIN in comparison to the total cart-add count for the
  # query.
  attribute(:asin_cart_add_share, Float, from: "asinCartAddShare")

  # @return [Money]
  attribute(:asin_median_cart_add_price, Money, from: "asinMedianCartAddPrice")

  # @return [Integer] For a search query, the number of cart-adds that originate from the search result page
  # across all ASINs.
  attribute(:total_cart_add_count, Integer, from: "totalCartAddCount")

  # @return [Float] For a search query, the number of cart-adds across all ASINs divided by the search query
  # volume.
  attribute(:total_cart_add_rate, Float, from: "totalCartAddRate")

  # @return [Money]
  attribute(:total_median_cart_add_price, Money, from: "totalMedianCartAddPrice")

  # @return [Integer] The number of times customers add any ASIN with the one-day delivery message to a cart from
  # the search results page for the specific query.
  attribute(:total_one_day_shipping_cart_add_count, Integer, from: "totalOneDayShippingCartAddCount")

  # @return [Integer] The number of times customers add any ASIN with the same-day delivery message to a cart from
  # the search results page for the specific query.
  attribute(:total_same_day_shipping_cart_add_count, Integer, from: "totalSameDayShippingCartAddCount")

  # @return [Integer] The number of times customers add any ASIN with the two-day delivery message to a cart from
  # the search results page for the specific query.
  attribute(:total_two_day_shipping_cart_add_count, Integer, from: "totalTwoDayShippingCartAddCount")
end
SearchQueryPerformancePurchaseData =

The search query performance purchase data.

Structure.new do
  # @return [Money]
  attribute(:asin_median_purchase_price, Money, from: "asinMedianPurchasePrice")

  # @return [Integer] For a search query, the number of purchases for the current ASIN.
  attribute(:asin_purchase_count, Integer, from: "asinPurchaseCount")

  # @return [Float] The fraction of purchase actions for the ASIN in comparison to the total purchase count for
  # the query.
  attribute(:asin_purchase_share, Float, from: "asinPurchaseShare")

  # @return [Money]
  attribute(:total_median_purchase_price, Money, from: "totalMedianPurchasePrice")

  # @return [Integer] The number of times customers purchase any ASIN with a one-day delivery message from the
  # search results page for the specific query.
  attribute(:total_one_day_shipping_purchase_count, Integer, from: "totalOneDayShippingPurchaseCount")

  # @return [Integer] For a search query, the number of purchases that originate from the search result for any
  # ASIN.
  attribute(:total_purchase_count, Integer, from: "totalPurchaseCount")

  # @return [Float] For a search query, the number of purchases divided by the search query volume.
  attribute(:total_purchase_rate, Float, from: "totalPurchaseRate")

  # @return [Integer] The number of times customers purchase any ASIN with the same-day delivery message from the
  # search results page for the specific query.
  attribute(:total_same_day_shipping_purchase_count, Integer, from: "totalSameDayShippingPurchaseCount")

  # @return [Integer] The number of times customers purchase any ASIN with a two-day delivery message from the
  # search results page for the specific query.
  attribute(:total_two_day_shipping_purchase_count, Integer, from: "totalTwoDayShippingPurchaseCount")
end
SearchQueryPerformanceImpressionData =

The search query performance impression data.

Structure.new do
  # @return [Integer] The total number of impressions that originate from the search results page for the current
  # ASIN with the current query.
  attribute(:asin_impression_count, Integer, from: "asinImpressionCount")

  # @return [Float] The fraction of impressions for the ASIN in comparison to the total impression count for the
  # query.
  attribute(:asin_impression_share, Float, from: "asinImpressionShare")

  # @return [Integer] The total number of impressions that originate from the search results page for all ASINs
  # with the current query.
  attribute(:total_query_impression_count, Integer, from: "totalQueryImpressionCount")
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



16
17
18
# File 'lib/peddler/reports/selling_partner_search_query_performance.rb', line 16

def parse(hash)
  Report.parse(hash)
end