3rd party integrations
...
Tracking and Analytics
Purple Tracking

Tracking Configuration

13min

Summary

This chapter describes the configuration options of the "tracking_config.json" file. The two essential points of the configuration are the filter function and the configuration of events and preparation of the event data for specific tracking services.

  1. Filter function An app user basically interacts with the app. As a result of interaction all events described in the documentation are triggered within the app (e.g. when the app user opens the app menu, downloads an issue, buys a subscription, etc.). A complete overview of the events can be found in the Tracking Events chapter. Depending on a Purple customer's use case, not all events may be necessary to track. But that depends heavily on his use cases. Either the tracking service used does not support entire event types (e.g. no view events are supported) or a tracking service is used to create reports or user targeting campaigns that are only based on a few events (e.g. downloads of issues, inactive subscribers, etc.). This configuration is described in the chapter Configuration: Enable or disable events or attributes.
  2. Configuration of events and preparation of the event data for specific tracking services A Purple App can integrate various tracking services. Which tracking services are involved is done in the Purple Manager. At the technical level in the app, each of the integrated SKDs has its own API to send events to its backend. Depending on the API, the events must first be prepared for this before they are passed on to the corresponding API. This configuration is described in the chapter Configuration: Event and attribute.



In the graphic below you can see the part that is covered in this chapter:

Document image


tracking_config.json

Getting started

Lets start with a question: How to start from an empty file and end up with an fully configured tracking config?

Usually Purple provides you with a „ready to use“ tracking config file. This means that this configuration includes the most frequently used events and is sufficient for most use cases.

For various reasons, however, you may also want to adapt this configuration to your needs. So you are welcome to adjust that configuration before it is used in your app.

In the following we show the entire structure and all individual configuration options in an overview and refer to the respective sub-chapters in which the individual steps are described in detail. And now we start with an empty file!

Structure

Create new configuration file "tracking_config.json"

Right here where just start with an empty file to add your needs step by step. The tracking is configured in a file called "tracking_config.json". This file is part of the dynamic resources and is located there on the main level. More on the topic of dynamic resources and how to integrate the file there can be found in the Purple Experience Builder chapter. The content of "tracking_config.json" is described by a JSON format. The JSON consists of three logical hierarchical levels.

  1. Default and tracking service level
  2. Event types and attributes level
  3. Individual event and attributes level

You will get to know these points in the next steps.

Document image


Add the default section and for each tracking service its specific section.

Default and tracking service level

The top level configures the tracking services level and is divided into a "default" section and a separate section for each integrated tracking service. This level is detailed dealt within the subchapter Structure: Tracking services.

Document image


Add the sections of event types and the attributes section.

Event types and attributes level

Purple apps support tracking via several tracking services. Each tracking service usually distinguishes three types of events:

  1. Actions
  2. Views
  3. Purchases

Some tracking services also support attributes. These are fundamentally different from events because they do not represent an event that occurs at a specific time, but describe a state that an user or the app has.

Purple also use this division to reflect the behavior of the tracking services.

This level is detailed dealt within the subchapter Structure: Event types and attributes.

Document image


Identify individual events and attributes for your USE-CASES

Individual event and attributes level

At the lowest level, the individual events or attributes are configured. This configuration differs depending on the tracking service, event type or attribute. A description of which events and attributes you can find where and how to integrate them in the configuration can be found in chapter Structure: Individual events and attributes.

Important: At this point, you need to know your USE-CASES. In order to enable these USE-CASES, the necessary events must be identified.



Document image


Configuration

Configure individual events and attributes

Add events or attributes for your USE-CASE

In chapter Structure: Individual events and attributes you got to know which events or attributes you place in the correct places in the configuration. The next step is about the configuration of the events or attributes themselves and this point splits into two parts:

  1. The general structure of an event or attribute.
  2. The structure of an event or attribute for a specific tracking service

A general description of the structure of an event or the structure of an attribute can be found in the Configuration: Event and attribute chapter. The structure of events and attributes used by each specific tracking service can be found in their descriptions. The specific tracking services can be found on the Structure: Tracking services overview page.

Document image


Enrich event data

For efficient tracking, you have the option of enriching the events with additional data. Which data this is and how it works is described in the Configuration: Enrich event data chapter.

Document image


Enable or disable events

As default behavior, all events or attributes configured in the "tracking_config.json" are tracked. For various reasons, you may not want to track either entire event types or individual events, or vice versa.

This functionality is detailed dealt within the subchapter Configuration: Enable or disable events or attributes.

Document image


Full example: How to configure your specific events

Finally, it is time to combine all the individual steps and summarize them in a complete example.

Here is a quick overview of the steps you will learn in this example:

  1. Define your USE-CASES
  2. Select your tracking services for your USE-CASES
  3. Select needed events and attributes for your USE-CASES
  4. Configure these events and attributes
  5. Optional: Handle enabled/disabled

No time for that? Ok here is the final working code sample:

tracking_config.json

Would you like to follow the example step by step? Then read on here: Full example: How to configure your events