---
title: Full example: How to configure your events
slug: experience/full-example-how-to-configure-your-events
description: Learn how to create a tracking configuration using Firebase and Airship for push notifications and in-app messages in this comprehensive document. Discover the importance of customizing tracking for various use cases, supported by examples and JSON code s
docTags: 
createdAt: 2023-06-07T12:58:00.000Z
---

# Summary

In this article we show you an example how to create a full working tracking configuration supporting the use cases we defined for that example.&#x20;

## At this point we will summarize your findings again

If you have arrived at this point, then you have learned everything about the structure and configuration options of the "*tracking\_config.json*" file.

**Summary**

To recap you have learned&#x20;

- to **add** tracking services in [Structure: Tracking services](docId:28leVq2NVel_A-pErh1RD)
- to **add** event types and attributes in [Structure: Event types and attributes](docId:0TqsT6jKDTItNXenVBa8V)&#x20;
- to **add** indiviudal events and atributes in [Structure: Individual events and attributes](docId\:hekVCLX15jPBX-KxnfJEB)
- the **configuration options** of events and attributes itself in [Configuration: Event and attribute](docId\:dlHlkEz7IXhD33I4qab7k)
- to **enrich** your data in [Configuration: Enrich event data](docId\:veXP4mbWyBJAr50smSx1t)
- to **enable** or **disable** any event or attribute [Configuration: Enrich event data](docId\:veXP4mbWyBJAr50smSx1t).

Now you are ready to master configuring your tracking.&#x20; <font color="#3b9f0f">**Congratulations**</font>!

Finally, you are cordially invited to go through all the configuration options described as follows.

# Lets start step by step:

## Define your USE-CASES

We will start with the most important point:&#x20;

**"Identifying your use cases"**

The emphasis here is on "**your**". While Purple offers a "*ready to use*" config that is sufficient for common use cases, it still needs further customization if your use cases are not covered.

:::hint{type="info"}
Your use cases influence *which* tracking service you have to use, *which* events or attributes you need for this and *how* these are configured in detail.
:::

We sum up some simple USE-CASES (in a real world scenario your USE-CASES may be more complex.):

- I want to know my top 5 downloads in 2022.
- I want to know which issues/pages have been bookmarked.
- Which search terms are used in the internal search of the app?
- Does anyone use the app menu?
- Does anyone buy subscriptions?
- I want to offer a discount to inactive subscribers to encourage them to subscribe again (via push or in app message).

## Select your tracking services for your USE-CASES

*Identify requirements for the tracking services used:*

In our example, we want to notify app users on the one hand via push and on the other hand via in-app message.

Our decision falls on

- [Firebase](docId\:UTcmD84EbM3lbU7yBWE_S) to reach app users via push and
- [Airship](docId:2zVPrdxnGl_gLzp-U-YDe) to reach app users via in app messages by airships message center.

## Select needed events and attributes for your USE-CASES

In the next step, we first have to generalize our use cases and then find the appropriate event or attribute for it (we look for these in the [Tracking Events](docId\:WmhcwvhBk60lCGh5urtfO) chapter).

:::hint{type="info"}
**Generalize USE-CASES**

This step is necessary because a formulated use case often represents an evaluation of events.

*Based on our example:*
The use case "*I want to know my top 5 downloads in 2022*" represents an evaluation of events in the backend of the tracking service and is not carried out by the tracking of the app.
:::

The following overview shows the result of generalization and the search for events and attributes. The individual use cases are also already grouped by event type:

### Action-Events

| **USE-CASE**    | **I want to know my top 5 downloads in 2022.**                                       |
| --------------- | ------------------------------------------------------------------------------------ |
| Generalization  | For this evaluation we need the information about:<br />Which issues are downloaded? |
| Resulting event | [ISSUE\_DOWNLOADED](docId:8rrA4o7Vzdaw13Y-JOqEk)                                     |

| **USE-CASE**    | **I want to know which issues/pages have been bookmarked.**                          |
| --------------- | ------------------------------------------------------------------------------------ |
| Generalization  | For this evaluation we need the information about:<br />Which bookmarks are created? |
| Resulting event | [STOREFRONT\_BOOKMARK\_ADDED](docId:8rrA4o7Vzdaw13Y-JOqEk)                           |

| **USE-CASE**    | **Which search terms are used in the internal search of the app?** |
| --------------- | ------------------------------------------------------------------ |
| Generalization  | The use case already has a general formulation.                    |
| Resulting event | [STOREFRONT\_SEARCH\_PERFORMED](docId:8rrA4o7Vzdaw13Y-JOqEk)       |

### View-Events

| **USE-CASE**    | **Does anyone use the app menu?**               |
| --------------- | ----------------------------------------------- |
| Generalization  | The use case already has a general formulation. |
| Resulting event | [APP\_MENU](docId\:mIXE5-IjKbR47eUmMdyga)       |

### Purchase-Events

| **USE-CASE**    | **Does anyone buy subscriptions?**                                                         |
| --------------- | ------------------------------------------------------------------------------------------ |
| Generalization  | For this evaluation we need the information about:<br />Which subscriptions are purchased? |
| Resulting event | [STOREFRONT\_SUBSCRIPTION\_PURCHASED](docId\:mIxJ9wVzaLBAPWdBpAt29)                        |

### Attributes

| **USE-CASE**        | **I want to offer a discount to inactive subscribers to encourage them to subscribe again (via push or in app message).**                                                                                                                                                                                                                                                                                               |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Generalization      | For this evaluation we need two pieces of information:<br />* All app users who have ever purchased a subscription.
  - This is already done with the purchase event STOREFRONT\_SUBSCRIPTION\_PURCHASED
* All app users who currently do not have an active subscription.
  - This is done with the resulting attribute HAS\_ACTIVE\_SUBSCRIPTION﻿<br />So this use case is a combination of this event and attribute. |
| Resulting attribute | [HAS\_ACTIVE\_SUBSCRIPTION](docId\:dFUCRmFGqFURGuiv8nlTC)                                                                                                                                                                                                                                                                                                                                                               |

## Configure these events and attributes

Now that we know our events and attributes, it's time to configure them in the "*tracking\_config.json*":

### Action-Events

**STOREFRONT\_ISSUE\_BOOKMARK\_ADDED**

:::CodeblockTabs
Airship

```json
"STOREFRONT_ISSUE_BOOKMARK_ADDED": {
  "templates": {
    "action": "issue_bookmark_added"
  },
  "parameters": {
    "bookmark_page_label": "{{BOOKMARK_PAGE_LABEL}}",
    "issue_name": "{{ISSUE_NAME}}"
  }
}
```

Firebase

```json
"STOREFRONT_ISSUE_BOOKMARK_ADDED": {
  "templates": {
    "action": "issue_bookmark_added"
  },
  "parameters": {
    "bookmark_page_label": "{{BOOKMARK_PAGE_LABEL}}",
    "issue_name": "{{ISSUE_NAME}}"
  }
}
```
:::

**ISSUE\_DOWNLOADED**

:::CodeblockTabs
Airship

```json
"ISSUE_DOWNLOADED": {
  "templates": {
    "action": "issue_downloaded"
  },
  "parameters": {
    "issue_id": "{{ISSUE_ID}}",
    "issue_name": "{{ISSUE_NAME}}",
    "publication_name": "{{PUBLICATION_NAME}}"
  }
}
```

Firebase

```json
"ISSUE_DOWNLOADED": {
  "templates": {
    "action": "issue_downloaded"
  },
  "parameters": {
    "issue_id": "{{ISSUE_ID}}",
    "issue_name": "{{ISSUE_NAME}}",
    "publication_name": "{{PUBLICATION_NAME}}"
  }
}
```
:::

**STOREFRONT\_SEARCH\_PERFORMED**

:::CodeblockTabs
Airship

```json
"STOREFRONT_SEARCH_PERFORMED": {
  "templates": {
    "action": "search_performed"
  },
  "parameters": {
    "phrase": "{{PHRASE}}"
  }
}
```

Firebase

```json
"STOREFRONT_SEARCH_PERFORMED": {
  "templates": {
    "action": "search_performed"
  },
  "parameters": {
    "phrase": "{{PHRASE}}"
  }
}
```
:::

### View-Events

**APP\_MENU**

:::CodeblockTabs
Airship

```json
"APP_MENU": {
  "templates": {
    "name": "app_menu"
  }
}
```

Firebase

```json
"APP_MENU": {
  "templates": {
    "name": "app_menu"
  }
}
```
:::

### Purchase-Events

**STOREFRONT\_SUBSCRIPTION\_PURCHASED**

:::CodeblockTabs
Airship

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

Firebase

```json
// firebase does not support purchase events
```
:::

### Attributes

**HAS\_ACTIVE\_SUBSCRIPTION**

:::CodeblockTabs
Airship

```json
"HAS_ACTIVE_SUBSCRIPTION": {
  "templates": {
    "name": "has_active_subscription"
  },
  "parameters": {
    "tag_group": "subscriptions"
  }
}
```

Firebase

```json
"HAS_ACTIVE_SUBSCRIPTION": {
  "templates": {
    "name": "has_active_subscription"
  }
}
```
:::

## Optional: Enable or disable events

We set our tracking services as follows:

:::CodeblockTabs
Enabled and disabled events

```json
{
  "default": {
    "eventsEnabledByDefault": true,
    "viewsEnabledByDefault": true,
    "purchasesEnabledByDefault": false,
    "attributesEnabledByDefault": false,
    "events": {},
    "views": {},
    "purchases": {},
    "attributes": {}
  },
  "airship": {
    "eventsEnabledByDefault": true,
    "viewsEnabledByDefault": true,
    "purchasesEnabledByDefault": true,
    "attributesEnabledByDefault": true,
    "events": {
      ...
    },
    "views": {
      ...
    },
    "purchases": {
      ...
    },
    "attributes": {
      ...
    }
  },
  "firebase": {
    "eventsEnabledByDefault": true,
    "viewsEnabledByDefault": true,
    "purchasesEnabledByDefault": false,
    "attributesEnabledByDefault": true,
    "events": {
      ...
    },
    "views": {
      ...
    },
    "purchases": {},
    "attributes": {
      ...
    }
  }
}
```
:::

## Final code example

Finally, we put everything together and get the following "*tracking\_config.json*":

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

:::CodeblockTabs
Final code example

```json
{
  "default": {
    "eventsEnabledByDefault": true,
    "viewsEnabledByDefault": true,
    "purchasesEnabledByDefault": false,
    "attributesEnabledByDefault": false,
    "events": {},
    "views": {},
    "purchases": {},
    "attributes": {}
  },
  "airship": {
    "eventsEnabledByDefault": true,
    "viewsEnabledByDefault": true,
    "purchasesEnabledByDefault": true,
    "attributesEnabledByDefault": true,
    "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_analytics": {
    "eventsEnabledByDefault": true,
    "viewsEnabledByDefault": true,
    "purchasesEnabledByDefault": false,
    "attributesEnabledByDefault": true,
    "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"
        }
      }
    }
  }
}
```
:::
::::

## How to proceed from here

To test this tracking configuration, you need to make it available in your app. Since this file is part of the dynamic resources, you can integrate it with the [Purple Experience Builder](docId\:KMuf0oag3Of3A46iUp5q4) at this point.&#x20;

*Further requirements:*
It is also neccessary …

- that you have your own account for the used tracking services and configured them.
- that your tracking services are configured and activated in your app in the purple manager.

