Skip to content

Custom Event Tracking

Abstract

Custom Event tracking implementations give agencies the flexibility to track additional events/attributes that are not tracked by default.

Warning

Custom event will not be visible in the mobile dashboard because we are still working on consolidating all agencies mobile app flows.

Introduction

Custom tracking provides users a way to define and collect additional data fields at a certain point of time that would otherwise not be tracked with the base trackers.

Some example custom tracking scenarios include:

  • tracking specific button clicks
  • tracking specific drop down fields selected
  • custom rules (e.g. user has login to site)

Getting Started

There are 4 fields introduced to aid you in custom tracking:

Field Required Data Type Description
Category Yes String Category name of event
Action Yes String Action performed/ event name
Label No String Action identification e.g. the ID of the transaction
Property No String A string value associated with the object of the action
Value No Double A numeric value to quantify or further describe the action/event e.g. the value of the cart item

Implementation

The custom tracking can be implemented to your desired context to collect specific data points of your end user behaviour with the app.

iOS implementation

For iOS, invoke Tracker.trackEvent function.

iOS Example 1

In this example, we simulate a custom tracking which is triggered when a user starts Transaction Service 1.

The desired fields to be tracked are as followed:

  • Category: 'transaction'
  • Action: 'start-transaction'
  • Label: 'tx-123456'
  • Property: 'transaction-service-1'

Code Snippet

Tracker.trackEvent(with: "transaction", action: "start-transaction", label: "tx-123456", property: "transaction-service-1")

iOS Example 2

In this example, we simulate a custom tracking which is triggered upon checkout of a e-commerce cart to track the value of the cart items.

The desired fields to be tracked are as followed:

  • Category: 'e-commerce'
  • Action: 'checkout'
  • Label: 'tx-12345'
  • Value: 99.99

Code Snippet

Tracker.trackEvent(with: "e-commerce", action: "checkout", label: "tx-12345", value: 99.99)

Android implementation

Similarly for Android apps, invoke the Tracker.trackEvent function.

Android Example 1

In this example, we simulate a custom tracking which is triggered when a user starts Transaction Service 1.

The desired fields to be tracked are as followed:

  • Category: 'transaction'
  • Action: 'start-transaction'
  • Label: 'tx-123456'
  • Property: 'transaction-service-1'

Code Snippet

Tracker.trackEvent("transaction", "start-transaction", "tx-123456", "transaction-service-1");

Android Example 2

In this example, we simulate a custom tracking which is triggered upon checkout of a e-commerce cart to track the value of the cart items.

The desired fields to be tracked are as followed:

  • Category: 'e-commerce'
  • Action: 'checkout'
  • Label: 'tx-12345'
  • Value: 99.99

Code Snippet

Tracker.trackEvent("e-commerce", "checkout", "tx-12345", "99.99");

React Native implementation

For React Native apps, invoke the Tracker.trackEvent function.

React Native Example 1

In this example, we simulate a custom tracking which is triggered when a user starts Transaction Service 1.

The desired fields to be tracked are as followed:

  • Category: 'transaction'
  • Action: 'start-transaction'
  • Label: 'tx-123456'
  • Property: 'transaction-service-1'

Code Snippet

Tracker.trackEvent("transaction", "start-transaction", "tx-123456", "transaction-service-1");

React Native Example 2

In this example, we simulate a custom tracking which is triggered upon checkout of a e-commerce cart to track the value of the cart items.

The desired fields to be tracked are as followed:

  • Category: 'e-commerce'
  • Action: 'checkout'
  • Label: 'tx-12345'
  • Value: 99.99

Code Snippet

Tracker.trackEvent("e-commerce", "checkout", "tx-12345", "99.99");