---
title: Configuration: Event and attribute
slug: experience/configuration-event-and-attribute
description: Learn about the structure and components of event tracking configuration, including the tracking key, enabled property, templates, and parameters. Discover how the placeholder template engine enhances event data. Explore an example tracking configuration.
docTags: 
createdAt: 2023-06-07T12:50:48.000Z
---

## Summary

This article is about the general composition of an event and an attribute itself. In the following you will learn the structure and the meaning of the individual components and which you can change and how.

This article is structured as follows:&#x20;

- Structure of events and attributes
- Introduction to the placeholder template engine
- Example

## Structure of events and attributes

The generic structure of an event or attribute is divided into four parts, which you can see in the figure below:

![](https://api.archbee.com/api/optimize/ygR6KtT9QI_R0u3uKTJsm/URLsGfKaII_46IdnBFEf3_0401configevent.png)

**Summary of the parts:**

(1) The "<font color="#2166ae">**tracking_key**</font>"
(2) The „<font color="#2166ae">**enabled**</font>“ property
(3) The key/value pairs of „<font color="#2166ae">**templates**</font>“
(4) The key/value pairs of „<font color="#2166ae">**parameters**</font>“

These four components are described in detail below.

### Property "tracking\_key"

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
<font color="#2166ae">**Property: "tracking_key"**</font>

The value of a tracking key is a constant and is used to uniquely assign an event that is fired within the app and its configuration within the "*tracking\_config.json*" file.&#x20;

The tracking key itself is always **UPPERCASED**<font color="#9900ef">*****</font> and separated by **underscores**<font color="#9900ef">*****</font>. So it is important that you always use the constants provided by Purple and do not change these tracking keys in your configuration.&#x20;

The events itself are all documented using these tracking keys which you can find in the chapter [Tracking Events](docId\:WmhcwvhBk60lCGh5urtfO) and its sub chapters. But some of the events are not documented this way, because of its dependency to the <font color="#3b9f0f">content_type</font> of the related content.&#x20;

An example may be [\<content\_type>\_OPENED](docId:8rrA4o7Vzdaw13Y-JOqEk). You can find a detailed description about this topic in the chapter [Content types](docId\:Tz-lFYAgszxfBnSpzmiWQ).

If you're having trouble determining what content types your content have, contact Purple's Customer Success or your assigned Purple Project Manager for help.

<font color="#9900ef">(*)</font> This definition applies solely to the events provided by Purple. The tracking keys of additional, customer-specific events can be freely defined.
:::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/ygR6KtT9QI_R0u3uKTJsm/fDWsEVNcdyYvZ5Jiw14IB_0402configeventtrackingkey.png)
:::
::::

:::hint{type="info"}
**Configuration summary:**

- The tracking key maps the app internal event to the event configuration within "*tracking\_config.json*".
- Always completely **UPPERCASED** and separated by **underscores.**
- Do **not** change these keys.
:::

### Property "enabled"

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
<font color="#2166ae">**Property: "enabled"**</font>

Using this property you may enable or disable this event or attribute.&#x20;

There are three cases:

Explicitly set: <font color="#3b9f0f">**true**</font> => enable this event for tracking <font color="#3b9f0f">**false**</font> => disable this event for tracking

or omitted:&#x20;
\=> When omitted the app uses the fallback to the

- "<font color="#2166ae">*eventsEnabledByDefault*</font>"
- "<font color="#2166ae">*viewsEnabledByDefault*</font>"
- "<font color="#2166ae">*purchasesEnabledByDefault*</font>"
- "<font color="#2166ae">*attributesEnabledByDefault*</font>"

properties used when configuring your tracking service within the "*tracking\_config.json*" file.&#x20;

But wait, you never heard about that enable properties? Thats right and all you have to know about this, is described within the chapter [Configuration: Enable or disable events or attributes](docId\:tpW_PzTETQGVomYtVj-dd)
:::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/ygR6KtT9QI_R0u3uKTJsm/VW7bv0LmmfuBVFXblnmE9_0403configeventenabled.png)
:::
::::

:::hint{type="info"}
**Configuration summary:**

- This property **enables** or **disables** this event or attribute.
- Three states are possible&#x20;
  - **true** o&#x72;**&#x20;false** assigned to the enabled property
  - enabled property is omitted
:::

### The key/value pairs of "templates"

:::::VerticalSplit{layout="middle"}
::::VerticalSplitItem
<font color="#2166ae">**Property: "templates"**</font>

Each event or attribute has templates. They are used to configure the tracking services. The template names map to the native API of the specific tracking service SDK and each tracking service supports different templates.

**Template**

A template consists of a <font color="#2166ae">**template**</font> <font color="#2166ae">**key**</font> and a <font color="#3b9f0f">**value**</font>. The keys must **not** be changed because they are fixed and used for mapping. The value can be changed to anything you want.&#x20;

:::hint{type="warning"}
Depending on the tracking services you use, there may be some restrictions that apply when transmitting the <font color="#2166ae">**keys**</font> and <font color="#3b9f0f">**values**</font>:

- The **length** of key is restricted
- The **length** of value is restricted
- The **allowed** characters are restricted
:::


::::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/ygR6KtT9QI_R0u3uKTJsm/pII-t-a3fX5TPBYTZ97b5_0404configeventtemplates.png)
:::
:::::

**Structure of a template (key/value pair)**

<font color="#2166ae">***key:***</font>

Common template keys are:

- "<font color="#2166ae">**action**</font>" for [Action events](docId:8rrA4o7Vzdaw13Y-JOqEk) and [Purchase events](docId\:mIxJ9wVzaLBAPWdBpAt29)
- "<font color="#2166ae">**name**</font>"  for [View events](docId\:mIXE5-IjKbR47eUmMdyga) and [Attributes](docId\:dFUCRmFGqFURGuiv8nlTC)

Other template keys used by specific tracking services are possible. You can find an overview of which templates a specific tracking service supports in the [Tracking Services](docId:3OFSGplKna2Zz3rZIK3fG) chapter and its sub chapters.

****<font color="#3b9f0f">***value:***</font>****

The value can be changed arbitrarily and can contain placeholders. What placeholders are is described in detail in the [Configuration: Enrich event data](docId\:veXP4mbWyBJAr50smSx1t) chapter.

:::hint{type="info"}
**Configuration summary:**

- Name of key is fixed and must **not** be changed.
- Values **can** be changed to anything and can contain **placeholders**.
- Restrictions may exist you have to consider in your configuration.
:::

### The key/value pairs of "parameters"

:::::VerticalSplit{layout="middle"}
::::VerticalSplitItem
<font color="#2166ae">**Property: "parameters"**</font>

Each event has parameters and they could be used to enrich your event data. Every parameter is sent together with the assigned event.&#x20;

**Parameter**

A parameter consists of a <font color="#2166ae">**parameter key**</font> and a <font color="#3b9f0f">**value**</font>. The keys and values can be changed to anything you want. However, it may happen that a specific tracking service can restrict this freedom of naming.

:::hint{type="warning"}
Due to the tracking services you use, there may be some restrictions that apply when transmitting the <font color="#2166ae">**keys**</font> and <font color="#3b9f0f">**values**</font>:

- The **length** of key is restricted
- The **length** of value is restricted
- The **allowed** characters are restricted
- The **count** of parameters itself is restricted
:::
::::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/ygR6KtT9QI_R0u3uKTJsm/UA3tfTtcUUKyiCmR8tDf7_0405configeventparameters.png)
:::
:::::

**Structure of a parameter (key/value pair)**

<font color="#2166ae">***key:***</font>

Common parameter key names are:

- "<font color="#2166ae">**issue_id**</font>"&#x20;
- "<font color="#2166ae">**publication_id**</font>"
- "<font color="#2166ae">**product_id**</font>"

The parameter key name is freely defined. However, is it recommend to follow Purples proposal for its naming convention which is described in detail within the [example](docId\:veXP4mbWyBJAr50smSx1t) in the [Configuration: Enrich event data](docId\:veXP4mbWyBJAr50smSx1t) chapter.

****<font color="#3b9f0f">***value:***</font>****

The value can be changed arbitrarily and can contain placeholders. What placeholders are is described in detail in the [Configuration: Enrich event data](docId\:veXP4mbWyBJAr50smSx1t) chapter.

:::hint{type="info"}
**Configuration summary:**

- Name of key can be changed but is **not** recommend. You should follow Purple's naming convention.
- Values **can** be changed to anything and can contain **placeholders**.
- Restrictions may exist you have to consider in your configuration.
:::

## Introduction to the placeholder template engine

Values of templates and parameters may contain placeholders within the value part and are referenced in the „*tracking\_config.json*“ by using the following syntax:

<font color="#3b9f0f">**{{PLACEHOLDER_NAME}}**</font>

The placeholder template engine replaces the placeholder with its associated value, which is only available and known at app runtime.

A full description about the functionality of placeholders can be found in chapter [Configuration: Enrich event data](docId\:veXP4mbWyBJAr50smSx1t).

## Example

In the following you see a tracking configuration simplified to events and attributes:

::::ExpandableHeading
### tracking\_config.json

:::CodeblockTabs
Example code&#x20;

```json
{
  "default": {
    "events": {},
    "views": {},
    "purchases": {},
    "attributes": {}
  },
  "airship": {
    "events": {
      "STOREFRONT_ISSUE_BOOKMARK_ADDED": {
        "templates": {
          "action": "issue_bookmark_added"
        }
      },
      "ISSUE_DOWNLOADED": {
        "templates": {
          "action": "issue_downloaded"
        }
      },
      "STOREFRONT_SEARCH_PERFORMED": {
        "templates": {
          "action": "search_performed"
        }
      }
    },
    "views": {
      "APP_MENU": {
        "templates": {
          "name": "app_menu"
        }
      }
    },
    "purchases": {
      "STOREFRONT_SUBSCRIPTION_PURCHASED": {
        "templates": {
          "action": "subscription_purchased"
        }
      }
    },
    "attributes": {
      "HAS_ACTIVE_SUBSCRIPTION": {
        "templates": {
          "name": "has_active_subscription"
        },
        "parameters": {
          "tag_group": "subscriptions"
        }
      }
    }
  },
  "firebase": {
    "events": {
      "STOREFRONT_ISSUE_BOOKMARK_ADDED": {
        "templates": {
          "action": "issue_bookmark_added"
        }
      },
      "ISSUE_DOWNLOADED": {
        "templates": {
          "action": "issue_downloaded"
        }
      },
      "STOREFRONT_SEARCH_PERFORMED": {
        "templates": {
          "action": "search_performed"
        }
      }
    },
    "views": {
      "APP_MENU": {
        "templates": {
          "name": "app_menu"
        }
      }
    },
    "purchases": {},
    "attributes": {
      "HAS_ACTIVE_SUBSCRIPTION": {
        "templates": {
          "name": "has_active_subscription"
        }
      }
    }
  }
}
```
:::
::::



