Full example: How to configure your events
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.
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
- to add tracking services in Structure: Tracking services
- to add event types and attributes in Structure: Event types and attributes
- to add indiviudal events and atributes in Structure: Individual events and attributes
- the configuration options of events and attributes itself in Configuration: Event and attribute
- to enrich your data in Configuration: Enrich event data
- to enable or disable any event or attribute Configuration: Enrich event data.
Now you are ready to master configuring your tracking. Congratulations! 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:
"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.
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 to reach app users via push and
- Airship 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 chapter).
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: Which issues are downloaded? |
Resulting event |
USE-CASE | I want to know which issues/pages have been bookmarked. |
|---|---|
Generalization | For this evaluation we need the information about: Which bookmarks are created? |
Resulting event |
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 |
View-Events
USE-CASE | Does anyone use the app menu? |
|---|---|
Generalization | The use case already has a general formulation. |
Resulting event | APP_MENU |
Purchase-Events
USE-CASE | Does anyone buy subscriptions? |
|---|---|
Generalization | For this evaluation we need the information about: Which subscriptions are purchased? |
Resulting event |
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:
So this use case is a combination of this event and attribute. |
Resulting attribute |
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
"STOREFRONT_ISSUE_BOOKMARK_ADDED": {
"templates": {
"action": "issue_bookmark_added"
},
"parameters": {
"bookmark_page_label": "{{BOOKMARK_PAGE_LABEL}}",
"issue_name": "{{ISSUE_NAME}}"
}
}ISSUE_DOWNLOADED
"ISSUE_DOWNLOADED": {
"templates": {
"action": "issue_downloaded"
},
"parameters": {
"issue_id": "{{ISSUE_ID}}",
"issue_name": "{{ISSUE_NAME}}",
"publication_name": "{{PUBLICATION_NAME}}"
}
}STOREFRONT_SEARCH_PERFORMED
"STOREFRONT_SEARCH_PERFORMED": {
"templates": {
"action": "search_performed"
},
"parameters": {
"phrase": "{{PHRASE}}"
}
}View-Events
APP_MENU
"APP_MENU": {
"templates": {
"name": "app_menu"
}
}Purchase-Events
STOREFRONT_SUBSCRIPTION_PURCHASED
"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
"HAS_ACTIVE_SUBSCRIPTION": {
"templates": {
"name": "has_active_subscription"
},
"parameters": {
"tag_group": "subscriptions"
}
}Optional: Enable or disable events
We set our tracking services as follows:
{
"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":
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 at this point. 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.