Class: Google::Apis::ContentV2_1::TopicTrends

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/content_v2_1/classes.rb,
lib/google/apis/content_v2_1/representations.rb,
lib/google/apis/content_v2_1/representations.rb

Overview

Topic trends fields requested by the merchant in the query. Field values are only set if the merchant queries TopicTrendsView. Forecast data can be queried up to 13 weeks by passing a future date in the date field. Historical data is measured daily, and forecasted data is projected weekly. All data points are normalized based on the highest data points returned in the response. If you make separate queries with different date ranges, you might see different values for the same date in each response. The recommended way to get a trend score of a topic is last7_days_search_interest / last$day _days_search_interest - 1. You can view trends for up to eight topics at a time.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TopicTrends

Returns a new instance of TopicTrends.



14140
14141
14142
# File 'lib/google/apis/content_v2_1/classes.rb', line 14140

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#customer_country_codeString

Country trends are calculated for. Must be a two-letter country code (ISO 3166- 1-alpha-2 code), for example, “US”. Corresponds to the JSON property customerCountryCode

Returns:

  • (String)


14082
14083
14084
# File 'lib/google/apis/content_v2_1/classes.rb', line 14082

def customer_country_code
  @customer_country_code
end

#dateGoogle::Apis::ContentV2_1::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, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type. TimeOfDay * google.type.DateTime * google.protobuf.Timestamp Corresponds to the JSON property date



14094
14095
14096
# File 'lib/google/apis/content_v2_1/classes.rb', line 14094

def date
  @date
end

#last120_days_search_interestFloat

Search interest in the last 120 days, with the same normalization as search_interest. This field is only present for a past date. Corresponds to the JSON property last120DaysSearchInterest

Returns:

  • (Float)


14100
14101
14102
# File 'lib/google/apis/content_v2_1/classes.rb', line 14100

def last120_days_search_interest
  @last120_days_search_interest
end

#last30_days_search_interestFloat

Search interest in the last 30 days, with the same normalization as search_interest. This field is only present for a past date. Corresponds to the JSON property last30DaysSearchInterest

Returns:

  • (Float)


14106
14107
14108
# File 'lib/google/apis/content_v2_1/classes.rb', line 14106

def last30_days_search_interest
  @last30_days_search_interest
end

#last7_days_search_interestFloat

Search interest in the last 7 days, with the same normalization as search_interest. This field is only present for a past date. Corresponds to the JSON property last7DaysSearchInterest

Returns:

  • (Float)


14112
14113
14114
# File 'lib/google/apis/content_v2_1/classes.rb', line 14112

def last7_days_search_interest
  @last7_days_search_interest
end

#last90_days_search_interestFloat

Search interest in the last 90 days, with the same normalization as search_interest. This field is only present for a past date. Corresponds to the JSON property last90DaysSearchInterest

Returns:

  • (Float)


14118
14119
14120
# File 'lib/google/apis/content_v2_1/classes.rb', line 14118

def last90_days_search_interest
  @last90_days_search_interest
end

#next7_days_search_interestFloat

Estimated search interest in the next 7 days, with the same normalization as search_interest. This field is only present for a future date. Corresponds to the JSON property next7DaysSearchInterest

Returns:

  • (Float)


14124
14125
14126
# File 'lib/google/apis/content_v2_1/classes.rb', line 14124

def next7_days_search_interest
  @next7_days_search_interest
end

#search_interestFloat

Daily search interest, normalized to the time and country to make comparisons easier, with 100 representing peak popularity (from 0 to 100) for the requested time period and location. Corresponds to the JSON property searchInterest

Returns:

  • (Float)


14131
14132
14133
# File 'lib/google/apis/content_v2_1/classes.rb', line 14131

def search_interest
  @search_interest
end

#topicString

Google-provided topic trends are calculated for. Only top eight topics are returned. Topic is what shoppers are searching for on Google, grouped by the same concept. Corresponds to the JSON property topic

Returns:

  • (String)


14138
14139
14140
# File 'lib/google/apis/content_v2_1/classes.rb', line 14138

def topic
  @topic
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
# File 'lib/google/apis/content_v2_1/classes.rb', line 14145

def update!(**args)
  @customer_country_code = args[:customer_country_code] if args.key?(:customer_country_code)
  @date = args[:date] if args.key?(:date)
  @last120_days_search_interest = args[:last120_days_search_interest] if args.key?(:last120_days_search_interest)
  @last30_days_search_interest = args[:last30_days_search_interest] if args.key?(:last30_days_search_interest)
  @last7_days_search_interest = args[:last7_days_search_interest] if args.key?(:last7_days_search_interest)
  @last90_days_search_interest = args[:last90_days_search_interest] if args.key?(:last90_days_search_interest)
  @next7_days_search_interest = args[:next7_days_search_interest] if args.key?(:next7_days_search_interest)
  @search_interest = args[:search_interest] if args.key?(:search_interest)
  @topic = args[:topic] if args.key?(:topic)
end