With Enriched Values within Event Schema, you can seamlessly transform your event attributes and dimensions into valuable data points. Enrichments allow you to apply formulas or calculations on the incoming data within the events.

For example, if you want to calculate a commission of 5% on the transaction amount, you can define a formula as an enrichment. The result of the formula will become an enriched value, which will be populated as another attribute in the database. Moreover, the result is enhanced event data that aligns with your pricing model, enabling further analysis, filtering, and decision-making.

Benefits of Enrichments:

  1. Enrichments eliminate the need for you to perform calculations externally and send pre-calculated values to Togai.
  2. Now, you can send raw data to Togai and set up formulas within Togai to get the required output, including numerical formulas.

How to add and implement enriched values in Togai?

  1. Navigate to the event schemas section in the application, where you can view a list of all the existing schemas.
  2. Click on “New Event Schema” to define a new event schema. Within the new event schema, ensure that the attributes and dimensions are already defined as per the documentation.
  3. Here is an important point to take note of. Dependencies allow you to create settings that define external logic or data or values. Go to the Admin Center>Settings section and create a new setting, specifying the type of dependency you want to create. Once the dependency is created, go back to the event schema.
    Enrichments and dependencies can be added at the organization level, customer level, or account level.
  4. Click on “Add a Dependency” to associate a pre-created dependency with the enrichment.
  5. To add an enrichment, click on “Add Enrichment,” and fill in the necessary information such as Name, Field Type, Enrichment Type, and Value.
  6. Click on the “Add Enrichment” button at the bottom.

What is the difference between Usage Meters and Enrichment?

When working with Togai’s Event schema, both Enriched Values and Usage Meter allow you to apply formulas on attributes and dimensions to obtain new values. However, there are key differences between the two:

Analytics Tracking:

  • Usage Meters provide outputs that are tracked for analytics purposes. These outputs can be utilized for analytical insights and reporting.
  • Enriched Values, on the other hand, are treated as additional attribute values without specific analytics tracking. They serve as data points within the event schema, allowing for further processing and usage.

Combination and Usage:

  • Enriched Values from an event schema can be combined or used to create Usage Meters. This means that you can leverage EVs as inputs to formulate comprehensive usage calculations or pricing models.

Here is an elaborate example to help you understand enrichments better!

Let’s consider a payments infrastructure company that processes transactions and wants to implement a pricing model based on transaction amounts. They have defined different slabs with varying rates for each slab. To calculate the pricing for a transaction, they need to enrich the transaction amount with the applicable slab rate. Here’s how they could go about it!

  1. Create an event schema within Togai that includes the necessary fields, such as “transaction_amount” as an attribute and “slab_rate” as a dimension.
  2. In the event schema, add enrichment for the “transaction_amount” field to apply a formula that calculates the commission based on the transaction amount.
  3. Set up the enrichment to reference a pre-created dependency that defines the commission formula, such as “transaction_amount * 0.05” to calculate a 5% commission.
  4. When a transaction event is received, Togai automatically enriches the event by applying the formula specified in the enrichment for the “transaction_amount” field.
  5. The enriched event now includes an additional field, let’s say “commission_value,” which represents the calculated commission based on the transaction amount.