Attribute: storage - evolv-ai/metrics GitHub Wiki

The storage is used to specify where a value should be cached in order for it to be applied across pages.

The storage is an object indicating that the value should be cached with the following options:

  • key - a required key that indicates the key to store and retrieve from storage (The integration will prefix this key with evolv: )
  • type - (local|session|cookie) indicating localStorage, sessionStorage, or cookies. The default is session. Use cookie if cross subdomain tracking is needed.
  • resolveWith - What to resolve with when there are both a value and a cached value. Options are:
    • (new|cached) for type of string
    • (new|cached|sum|min|max) for type of number
    • (new|cached|and|or) for type of boolean
    • (new|cached|union) for type of array

Example

{
   "source": "dom",
   "on": "click",
   "tag": "add-to-cart.count", 
   "action": "bind",
   "value": 1, 
   "type": "number",
   "storage": {"type": "local", "key": "atc-count", "resolveWith": "sum"}
}