Class: Staccato::Measurement::ProductImpression
- Inherits:
-
Object
- Object
- Staccato::Measurement::ProductImpression
- Includes:
- Staccato::Measurable
- Defined in:
- lib/staccato/measurement/product_impression.rb
Overview
Measurement class for product impressions in a list
Constant Summary collapse
- FIELDS =
Product impression measurement options fields
{ index: nil, list_index: nil, id: 'id', # text name: 'nm', # text brand: 'br', # text category: 'ca', # text variant: 'va', # text price: 'pr', # currency (looks like a double?) position: 'ps' # integer }.freeze
Class Method Summary collapse
-
.lookup_key ⇒ Symbol
lookup key for use in Hit#add_measurement.
Instance Method Summary collapse
-
#custom_fields_allowed? ⇒ Boolean
product impression allow custom dimensions and metrics.
-
#prefix ⇒ String
product impress prefix.
Methods included from Staccato::Measurable
#add_custom_dimension, #add_custom_metric, #custom_dimensions, #custom_metrics, #fields, included, #initialize, #params
Class Method Details
.lookup_key ⇒ Symbol
lookup key for use in Hit#add_measurement
7 8 9 |
# File 'lib/staccato/measurement/product_impression.rb', line 7 def self.lookup_key :product_impression end |
Instance Method Details
#custom_fields_allowed? ⇒ Boolean
product impression allow custom dimensions and metrics
18 19 20 |
# File 'lib/staccato/measurement/product_impression.rb', line 18 def custom_fields_allowed? true end |
#prefix ⇒ String
product impress prefix
13 14 15 |
# File 'lib/staccato/measurement/product_impression.rb', line 13 def prefix 'il' + list_index.to_s + 'pi' + index.to_s end |