vn.teko.android.tracker:tracker-manager:1.0.0

New features#

  • Update TrackingHelperV2Interface: remove some methods
  • Any Activity and Fragment can be enabled to be tracked ScreenViewEvent by implement TrackableScreen
  • Support deeplink with ads parameters such as: utm_term, utm_campaign, utm_content, utm_source
  • Apply validation rule when initialize TrackingHelperV2
  • Standardize event properties by using enum

Changes#

TrackingHelperV2Interface#

  1. Remove method startNavigation()

Switch to auto-tracking mechanism by implementing TrackableScreen interface. Easy and time-less

  1. There is only one method for tracking ScreenViewEvent

If you don't want to use auto-tracking mechanism, you can use this method to manually track your screen.

  1. Add method trackFinishLoading()

When your screen is ready to use, user can see its content and action on it. Please call this method to measure the loading time.

TrackableScreen#

Activity and Fragment can be auto-tracked ScreenViewEvent by implement Trackable Screen.

  1. shouldTrack(): Boolean

We can have many fragments that base on this interface but it is only tracked if this function return [true]

With normal screen, you should override it and return [true].

With screen with tabs, you can expect that we only track on each fragment and do not track on parent fragment, so return [false]

  1. screenName(): ScreenViewEventBody.ScreenName

The name of this screen. It should be listed as enum class that is inherited from [ScreenViewEventBody.ScreenName]

  1. contentType: ScreenViewEventBody.ContentType

Which content this screen displays. It should be listed as enum class that is inherited from [ScreenViewEventBody.ContentType]

  1. referrerScreen(): ScreenViewEventBody.ScreenName (optional)

Which screen starts this fragment. Leave it null to automatically track previous screen.

Custom it if you have another scenarios like push notification or something else.

  1. sdkId(): String? (optional)

If your SDK integrates Tracking Library and you want to view what happened inside your SDK. Give it an id in right format (UUID)

return your SDK id. Or null if you are tracking on your app module

  1. sdkVersion(): String? (optional)

If your SDK integrates Tracking Library and you want to view what happened inside your SDK and what SDK version was in use.

return your SDK version is integrated. Or null if you are tracking on your app module

Deeplink Supported#

If your activity/fragment was start by deeplink with ads parameters (utm_term, utm_campaign, utm_content, utm_source), they will automatically recorded by ScreenViewEvent

TrackingHelperV2Interface has a method onNewIntent(activity, intent) is only required if your activity is start with launchMode = singleTask/singleTop

// in your activity
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
trackingHelperV2.onNewIntent(this, intent)
}

TrackerConfig validation#

appId now have to be follow by pattern \w{8}-\w{4}-\w{4}-\w{4}-\w{12}

Standardize event properties#

  1. AlertEvent

alertType now accept two types Popup, Toast defined by AlertEventBody.AlertType

  1. CartEvent

eventName now accept some enums listed by CartEventIdentifier.CartEventName.

  1. ScreenViewEvent

eventName now accept some two types listed by ScreenViewEventIdentifier.ScreenViewEventName

Two built-in screen were created for common usecases (Notificaton, ExternalSource)