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 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 docid\ wmhcwvhbk60lcgh5urtfo 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 docid\ tpw pztetqgvomytvj dd 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 docid\ dlhlkez7ixhd33i4qab7k in the graphic below you can see the part that is covered in this chapter 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 docid\ kmuf0oag3of3a46iup5q4 chapter the content of " tracking config json " is described by a json format the json consists of three logical hierarchical levels default and tracking service level event types and attributes level individual event and attributes level you will get to know these points in the next steps 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 docid 28levq2nvel a perh1rd 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 actions views 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 docid 0tqst6jkdtitnxenvba8v 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 docid\ hekvclx15jpbx kxnfjeb important at this point, you need to know your use cases in order to enable these use cases, the necessary events must be identified configuration configure individual events and attributes add events or attributes for your use case in chapter structure individual events and attributes docid\ hekvclx15jpbx kxnfjeb 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 the general structure of an event or attribute 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 docid\ dlhlkez7ixhd33i4qab7k 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 docid 28levq2nvel a perh1rd overview page 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 docid\ vexp4mbwybjar50smsx1t chapter 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 docid\ tpw pztetqgvomytvj dd 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 define your use cases select your tracking services for your use cases select needed events and attributes for your use cases configure these events and attributes optional handle enabled/disabled no time for that? ok here is the final working code sample tracking config json example { "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" { "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" } } } } } would you like to follow the example step by step? then read on here full example how to configure your events docid\ rbq5g0nowyznlarcpc1ds