Skip to content

Attributes

Richard Cowin edited this page Apr 8, 2024 · 7 revisions

Attributes are used to define the metrics. A metric can be abstract or concrete. The main requirements for concrete metrics, are objects that contain tag, source and key.

Possible attributes for a metric include:

  • source - Specifies where to get the audience attribute or event criteria from.
  • key - Specifies where to get the value in the source.
  • tag - Specifies what the metric will be reported as (event id for action event and audience attribute for action bind).
  • when - Is used to specify that the metric (or sub-metrics) have to meet the condition before they are to be applied.
  • action - Is either event or bind (bind is used if action is not specified)
  • on - Specifies that the metric should wait on an async event (typically used for DOM events).
  • apply - Indicates that the current metric is abstract and its content should be passed to the metrics in the apply array.
  • map - Specifies value options the value extracted needs further mapping.
  • type - Is used when action is bind to convert the type to.
  • extract - Is used for extracting values from more complex sources like dom content and callback parameters.
  • value - Specifies an explicit value when using action bind
  • storage - Specifies that the value of a bind action should be cached for reference on downline pages.
  • default - Specifies the value to bind to a metric when it is unable to find the value indicated by key.
  • poll - Allows the system to wait for some period of time and coninue trying to extract a value.
  • combination - Allows 2 numeric values (from different source/key) to be used to calculate a metric value.
  • macro - Allows groups of attributes to be packaged and reused.

Other non metrics attributes include:

  • defmacros - How macros are defined for sharing groups of attributes.
  • _<name> - Provides a mechanism to merge both integration and environment configurations.