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
more...

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.

[View source]

14187
14188
14189
# File 'lib/google/apis/content_v2_1/classes.rb', line 14187

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)

14129
14130
14131
# File 'lib/google/apis/content_v2_1/classes.rb', line 14129

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


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

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)

14147
14148
14149
# File 'lib/google/apis/content_v2_1/classes.rb', line 14147

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)

14153
14154
14155
# File 'lib/google/apis/content_v2_1/classes.rb', line 14153

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)

14159
14160
14161
# File 'lib/google/apis/content_v2_1/classes.rb', line 14159

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)

14165
14166
14167
# File 'lib/google/apis/content_v2_1/classes.rb', line 14165

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)

14171
14172
14173
# File 'lib/google/apis/content_v2_1/classes.rb', line 14171

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)

14178
14179
14180
# File 'lib/google/apis/content_v2_1/classes.rb', line 14178

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)

14185
14186
14187
# File 'lib/google/apis/content_v2_1/classes.rb', line 14185

def topic
  @topic
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object

[View source]

14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
# File 'lib/google/apis/content_v2_1/classes.rb', line 14192

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