Skip to content

Tags and Schema for Event Tracking

Getting Started

In the Palzin Track system, users have the capability to attach up to 5 tags to each tracked event, allowing for personalized organization and categorization. These tags consist of a key, which defines the category or type of the tag, along with an associated value. For instance, events can be tagged with a user ID using the following schema:

json
{
  "user-id": "uid-12345",
  "premium": true
}
{
  "user-id": "uid-12345",
  "premium": true
}

Schema Guidelines

Keys

Keys within the schema adhere to the following pattern: [a-z]+(?:-[a-z]+)*. This implies that keys can exclusively consist of lowercase alphabetical characters and can be optionally separated by dashes ("-"). Some examples of valid keys include: age, username, user-id, and email.

Values

Values within the schema can be of the types: String, Number, or Boolean. It's strongly recommended to maintain consistency in the value type for each respective key. For instance, if you're utilizing the age key, it's advisable to consistently use integer values like 20, 30, 40 as opposed to mixing data types.

Additionally, note that our system automatically converts numbers and booleans presented as strings back to their original value types. For instance, the string "19" will be transformed into the integer 19, and strings like "true" or "True" will be converted to the boolean value true.

Usage Examples

Here are a couple of examples to illustrate the usage of tags and schema in event tracking:

json
{
  "email": "[email protected]",
  "age": 25,
  "name": "john doe"
}
{
  "email": "[email protected]",
  "age": 25,
  "name": "john doe"
}
json
{
  "product-id": "my-12345",
  "delivered": false
}
{
  "product-id": "my-12345",
  "delivered": false
}

By following these guidelines, users can effectively leverage tags and schema to enrich the context of tracked events and enhance the overall organization and analysis of data.