Enrichments

Overview

Enrichments give you the ability to add new information into your events that are not initially included when your analytics.js event payload reaches MetaRouter. Through the UI, you can designate a new key:value pair to add into an event.

Enrichment Types

The following enrichment types are available through the MetaRouter UI.

Direct Value

Direct Values can be used for setting default values on an output event. All direct value enrichments simply set the output key value to your specified static value.

The static value you set can be one of the following data types:

  • Boolean
  • Float
  • Integer
  • String

The above example will add to the output event the following key:value pair:

"currencyCode": "USD"

UUID

The UUID option assigns a universally unique id as the output key. The result value is a string.

UUID v1 is generated by using a combination of the host computer's MAC address and the current date and time. In addition to this, it also introduces another random component to supplement its uniqueness.

UUID v4 is generated randomly and with no inherent logic.

We recommend using UUID v4 where possible, as the chances of a duplicate value are slim to none.

UUID v1 Example

The above example will add to the output event the following key:value pair:

"uuid1": "bf40eff8-03fe-11eb-adc1-0242ac120002"

UUID v4 Example

The above example will add to the output event the following key:value pair:

"uuid4": "e9e202c1-e593-4f42-944b-78b7a6613230"

Timestamp

Timestamp uses the current server’s time to generate an output key value. The output is a Number, and more specifically an Integer.

Available formats:

  • milliseconds: Generates a number representing the number of milliseconds since the UNIX Epoch.
  • seconds: Generates a number representing the number of seconds since the UNIX Epoch.

Seconds Timestamp Example

The above example will add to the output event the following key:value pair:

"time": 1601568572

Milliseconds Timestamp Example

The above example will add to the output event the following key:value pair:

"time": 1601568572615

Date

Date uses the current server’s time to generate a date or date-time string based on the provided format. The date format argument requires Go’s formatting dialect.

Example

The above example will add to the output event the following key:value pair:

"date": "10-01-2020 16:09 UTC"