---
title: Configuration: Enrich event data
slug: experience/configuration-enrich-event-data
description: Learn how to enhance event data using placeholders in the "tracking_config.json" file to evaluate events in a tracking service. This document provides specific examples and outlines templates, parameters, views, purchases, and attributes for different pla
docTags: 
createdAt: 2023-06-29T15:53:03.061Z
---

## Summary

This article is about the ***enrichment*** of your event data. That can be done by using placeholders and by adding parameters to your event configuration.&#x20;

This article is structured as follows:&#x20;

- [Placeholders](docId\:veXP4mbWyBJAr50smSx1t) describes what placeholders are and how to find out which ones are available for your event.
- [Placeholder template engine](docId\:veXP4mbWyBJAr50smSx1t) describes how placeholders are used within your "*tracking\_config.json*" and how these values are replaced.
- [Templates and parameter](docId\:veXP4mbWyBJAr50smSx1t) describes where to add placeholders in your event configuration
- [Example](docId\:veXP4mbWyBJAr50smSx1t) shows the whole process of using placeholders, replacing them with concrete values and finally looking at the data sent to the tracking service.

## Placeholders

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>

:::hint{type="info"}
Placeholder names are always **UPPERCASED** and separated by **underscores**.

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

A list of all available placeholders can be found in chapter [Placeholder](docId\:HWgaxh6bT5orBprp0V9VG).&#x20;
:::

:::hint{type="warning"}
Please note, however, that not all placeholders are available for every event. Based on the documentation of a specific event, the available placeholders are always linked within the "**Placeholder**" tab. If none are available, this is marked accordingly.
:::

## Placeholder template engine

The placeholder template engine replaces the placeholder with its associated value, which is only available and known at app runtime. This means, for example, that the values of content are only available for tracking when an app user has an issue or article opened. The replacement of the placeholders is done before the event data is sent to the backend of the tracking service.

You can add placeholders in the value area of templates and parameters, which are described below.

## Templates and parameter

### Template

The first place placeholders can be used is within a template. Most events only make sense if placeholders are used in the templates. However, these can only be used in the value area of the template.

:::hint{type="info"}
As a reminder, the structure of a template within the „*tracking\_config.json*“ is as follows:

**"**<font color="#2166ae">**template_key**</font>**": "**<font color="#3b9f0f">**value of template**</font>**“**

**Short example:**

The template may be
**„**<font color="#2166ae">**action**</font>**“ : „**<font color="#3b9f0f">**issue_opened**</font>**“&#x2028;**

and enriched by a placeholder
**„**<font color="#2166ae">**action**</font>**“ : „**<font color="#3b9f0f">**issue_opened_{{ISSUE_ID}}**</font>**“**
:::

### Parameter

Some tracking services supports to send additional data with your event to the tracking service back end which is done by parameters which is a list of key/value pairs.&#x20;

It is useful to add parameters to your events. It is recommend to define your USE-CASES first. Then select the corresponding event(s) and have a look of the available placeholders. Finally derive a list of useful parameters and add them to the event configuration. &#x20;

:::hint{type="info"}
As a reminder, the structure of a parameter within the „*tracking\_config.json*“ is as follows:

**"**<font color="#2166ae">**parameter_key**</font>**": "**<font color="#3b9f0f">**value of parameter**</font>**“**

**Short example:**

The parameter may be
**„**<font color="#2166ae">**issue_id**</font>**“ : „**<font color="#3b9f0f">**static parameter value may be useless**</font>**“**

and enriched by a placeholder
**„**<font color="#2166ae">**issue_id**</font>**“ : „**<font color="#3b9f0f">**{{ISSUE_ID}}**</font>**“**
:::

## Example

In the example you will find two variants of a "*tracking\_config.json*" at the end, one with some events completely without data enrichment and one with data enrichment.

For example, let's take the following event:

:::CodeblockTabs
ISSUE\_DOWNLOADED

```json
"ISSUE_DOWNLOADED": {
  "templates": {
    "action": "issue_downloaded"
  }
}
```
:::

Without data enrichment, later evaluation of events in the respective front end of your tracking service is more than difficult.

The "<font color="#3b9f0f">**ISSUE_DOWNLOADED**</font>" event as shown does not provide any information about which issue was downloaded. All you see is that x app users have downloaded y issues.

It therefore makes sense to enrich your events with additional data. The above event could look like this:

:::CodeblockTabs
ISSUE\_DOWNLOADED

```json
"ISSUE_DOWNLOADED": {
  "templates": {
    "action": "issue_downloaded"
  },
  "parameters": {
    "issue_id": "{{ISSUE_ID}}",
    "issue_name": "{{ISSUE_NAME}}",
    "issue_categories": "{{ISSUE_CATEGORIES}}",
    "issue_tags": "{{ISSUE_TAGS}}",
    "issue_purchasable": "{{ISSUE_PURCHASABLE}}",
    "issue_purchased": "{{ISSUE_PURCHASED}}",
    "publication_id": "{{PUBLICATION_ID}}",
    "publication_name": "{{PUBLICATION_NAME}}"
  }
}
```
:::

Advantages for your evaluation:

- You know the number of downloads per issue.
- You could create download statistics per issue.
- Is that issue purchasable?
- etc.

### Purple's recommendation for naming parameter names

When naming parameters, we recommend using the name of the placeholder in lowercase as the parameter name.

:::hint{type="info"}
**Example**

If you are interested in the issue name and want to use the placeholder "<font color="#3b9f0f">**ISSUE_NAME**</font>", then create a parameter with the key "<font color="#2166ae">**issue_name**</font>".

The parameter could therefore look like this:

**"**<font color="#2166ae">**issue_name**</font>**" : "\{\{**<font color="#3b9f0f">**ISSUE_NAME**</font>**}}"**

The transmission to your tracking service will then take place as follows for a “<font color="#3b9f0f">**May 2023**</font>” edition:

**"**<font color="#2166ae">**issue_name**</font>**" : "**<font color="#3b9f0f">**May 2023**</font>**"**
:::

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

:::CodeblockTabs
Example code without enrichment

```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"
        }
      }
    }
  }
}
```

Example code enriched

```json
{
  "default": {
    "events": {},
    "views": {},
    "purchases": {},
    "attributes": {}
  },
  "airship": {
    "events": {
      "STOREFRONT_ISSUE_BOOKMARK_ADDED": {
        "templates": {
          "action": "issue_bookmark_added"
        },
        "parameters": {
          "view": "{{VIEW}}",
          "bookmark_title": "{{BOOKMARK_TITLE}}",
          "bookmark_description": "{{BOOKMARK_DESCRIPTION}}",
          "bookmark_page_label": "{{BOOKMARK_PAGE_LABEL}}",
          "bookmark_creation_date": "{{BOOKMARK_CREATION_DATE}}",
          "issue_id": "{{ISSUE_ID}}",
          "issue_name": "{{ISSUE_NAME}}",
          "issue_categories": "{{ISSUE_CATEGORIES}}",
          "issue_tags": "{{ISSUE_TAGS}}",
          "issue_purchasable": "{{ISSUE_PURCHASABLE}}",
          "issue_purchased": "{{ISSUE_PURCHASED}}",
          "issue_product_id": "{{ISSUE_PRODUCT_ID}}",
          "publication_id": "{{PUBLICATION_ID}}",
          "publication_name": "{{PUBLICATION_NAME}}"
        }
      },
      "ISSUE_DOWNLOADED": {
        "templates": {
          "action": "issue_downloaded"
        },
        "parameters": {
          "issue_id": "{{ISSUE_ID}}",
          "issue_name": "{{ISSUE_NAME}}",
          "issue_categories": "{{ISSUE_CATEGORIES}}",
          "issue_tags": "{{ISSUE_TAGS}}",
          "issue_purchasable": "{{ISSUE_PURCHASABLE}}",
          "issue_purchased": "{{ISSUE_PURCHASED}}",
          "publication_id": "{{PUBLICATION_ID}}",
          "publication_name": "{{PUBLICATION_NAME}}"
        }
      },
      "STOREFRONT_SEARCH_PERFORMED": {
        "templates": {
          "action": "search_performed"
        },
        "parameters": {
          "view": "{{VIEW}}",
          "phrase": "{{PHRASE}}"
        }
      }
    },
    "views": {
      "APP_MENU": {
        "templates": {
          "name": "app_menu"
        }
      }
    },
    "purchases": {
      "STOREFRONT_SUBSCRIPTION_PURCHASED": {
        "templates": {
          "action": "subscription_purchased"
        },
        "parameters": {
          "transaction_id": "{{TRANSACTION_ID}}",
          "subscription_product_id": "{{PRODUCT_ID}}",
          "subscription_price": "{{PRICE}}",
          "subscription_price_currency": "{{CURRENCY_CODE}}",
          "subscription_id": "{{SUBSCRIPTION_ID}}",
          "subscription_name": "{{SUBSCRIPTION_NAME}}",
          "subscription_type": "{{SUBSCRIPTION_TYPE}}",
          "subscription_duration": "{{SUBSCRIPTION_DURATION}}",
          "subscription_price_formatted": "{{SUBSCRIPTION_PRICE}}",
          "subscription_purchased": "{{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"
        },
        "parameters": {
          "view": "{{VIEW}}",
          "bookmark_title": "{{BOOKMARK_TITLE}}",
          "bookmark_description": "{{BOOKMARK_DESCRIPTION}}",
          "bookmark_page_label": "{{BOOKMARK_PAGE_LABEL}}",
          "bookmark_creation_date": "{{BOOKMARK_CREATION_DATE}}",
          "issue_id": "{{ISSUE_ID}}",
          "issue_name": "{{ISSUE_NAME}}",
          "issue_categories": "{{ISSUE_CATEGORIES}}",
          "issue_tags": "{{ISSUE_TAGS}}",
          "issue_purchasable": "{{ISSUE_PURCHASABLE}}",
          "issue_purchased": "{{ISSUE_PURCHASED}}",
          "issue_product_id": "{{ISSUE_PRODUCT_ID}}",
          "publication_id": "{{PUBLICATION_ID}}",
          "publication_name": "{{PUBLICATION_NAME}}"
        }
      },
      "ISSUE_DOWNLOADED": {
        "templates": {
          "action": "issue_downloaded"
        },
        "parameters": {
          "issue_id": "{{ISSUE_ID}}",
          "issue_name": "{{ISSUE_NAME}}",
          "issue_categories": "{{ISSUE_CATEGORIES}}",
          "issue_tags": "{{ISSUE_TAGS}}",
          "issue_purchasable": "{{ISSUE_PURCHASABLE}}",
          "issue_purchased": "{{ISSUE_PURCHASED}}",
          "publication_id": "{{PUBLICATION_ID}}",
          "publication_name": "{{PUBLICATION_NAME}}"
        }
      },
      "STOREFRONT_SEARCH_PERFORMED": {
        "templates": {
          "action": "search_performed"
        },
        "parameters": {
          "view": "{{VIEW}}",
          "phrase": "{{PHRASE}}"
        }
      }
    },
    "views": {
      "APP_MENU": {
        "templates": {
          "name": "app_menu"
        }
      }
    },
    "purchases": {},
    "attributes": {
      "HAS_ACTIVE_SUBSCRIPTION": {
        "templates": {
          "name": "has_active_subscription"
        }
      }
    }
  }
}
```
:::


::::

