Source: extension - evolv-ai/metrics GitHub Wiki

The extension source will use the key as the name of an extension.

Currently there is only one extension:

  • distribution - provide a random number between 0-99
  • page - provides mechanism to observe entire page or window content

distribution

This supports a metric to allocate a visitor a distribution value. This distribution value can be used as a mechanism to bucket users exclusively into one experiment or an other.

{
    "tag": "distribution",
    "action": "bind",
    "source": "extension",
    "key": "distribution",
    "type": "number",
    "storage": {
        "type": "local",
        "key": "distribution",
        "resolveWith": "cached"
    }
}

See: Attribute: storage

page

An example for page extension is when setting up for Exit Intent and using macro events:

{
  "apply":[
    {
      "source": "extension",
      "key": "page",
      "action": "bind",
      "type": "boolean",
      "apply": [
          {
              "on": "scroll:speed:-80",
              "default": false,
              "value": true,
              "tag": "exit.mobile"
          },
          {
              "on": "mouseexit:top:100",
              "default": false,
              "value": true,
              "tag": "exit.desktop"
          },
          {
              "on": "idle:60000",
              "default": false,
              "value": true,
              "tag": "exit.all"
          }
      ]
    }
  ]
}

See: Extension: page