@evolv-delivery/metrics

1.4.0 • Public • Published

Metrics

The Metrics integration allows metrics (audience attributes and events) to be populated/emitted from dom, query parameters, datalayer, cookie, local storage, session storage, and more.

Why

The goal of the Metrics integration is to provide a central location where both audience attributes and events can be defined declaritively in a robust way that can be used to specify full funnel progression metrics across experiments.

Setup in the Evolv Manager

Adding an integration to the Evolv Manager

Configuration Concepts

The configuration json supports the creation of metrics through a hierarchical structure that provides both inheritance and filtering/conditions.

Inheritance is the idea of passing down common information (defined as attributes) to decendents of the current metric. The decendents can override the inherited attributes (and this is needed if you want to use Conditions). The mechanism of a metric passing inherited values is through the use of the apply attribute. When apply is present, the current metric is classified as an Abstract Metric.

If a metric and all of its decendents should only be applied when a condition is met, you can use the when attribute to conditionally filter whether the children should be evaluated.

Configuration Organization

The intent of the configuration json is to capture all metrics that will be captured as audience values or events. Each of these is referenced as a metric.

Metrics

Each metric can contain the following attributes:

  • when - is used to specify that the metric (or sub-metrics) have to meet the condition before they are to be applied
  • tag - specifies what the metric will be reported as (event id for action event and audience attribute for action bind)
  • source - specifies where to get the audience attribute or event critera
  • key - specifies where to get the value in the source
  • action - is either event or bind (bind is used if action is not specified)
  • type - is used when action is bind to convert the type to
  • apply - indicates that the current metric is abstract and its content should be passed to the metrics in the apply array
  • 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
  • map - specifies value options when the value extracted needs further mapping
  • 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 continue trying to extract a value
  • extract - provides mechanism to extract out values from an object or element
  • combination - allows two numeric values to be used in calculation of value

Abstract Metrics

If a metric has an apply attribute, then it is an abstract metric and its attributes are only to provide interited values to the metrics in its apply section. An abstract metric is never applied to the page directly. However, if its children override the source and key, the parent's source and key must be validated/available before the children are evaluated.

SPA

All metrics will be refreshed and reapplied when a history.pushstate is invoked if it is indicated in the Evolv snippet.

More Information

Package Sidebar

Install

npm i @evolv-delivery/metrics

Weekly Downloads

8

Version

1.4.0

License

ISC

Unpacked Size

83 kB

Total Files

6

Last publish

Collaborators

  • charles-evolv
  • joshua-barnard-evolv
  • yvanfrey-evolv
  • robertsevern
  • rcowin
  • matt-strom