For the complete documentation index, see llms.txt. This page is also available as Markdown.

Screen Tracking

For screen navigation in React Native, refer to the following React Native developer documentation.

React Native uses a single Activity/ViewController structure by default, making automatic screen information collection difficult.

To properly collect $page_view and $engagement events, you must directly call the setCurrentScreen method every time the screen changes.

setCurrentScreen

This feature is supported in React Native SDK version 3.30.0 and above.

Track screens using the setCurrentScreen(screen) method.

  • The minimum tracking time unit for screen tracking is 1 second.

  • The $engagement for pages changed within 1 second is not measured.

Parameter
Type
Required
Description

name

string

Required

The name of the current screen.

screenClass

string

Required

If you do not need a separate class name, enter the same value as name.

Example

Property

The Hackle SDK supports adding properties to Event objects.

  • The maximum number of properties that can be added to an event object is 64.

Type
Type
Constraints

Property Key (key)

string

  • Character limit is 128 characters.

  • Case-insensitive. For example, amount and AMOUNT are recognized as the same key.

Property Value (value)

boolean, string, number, array

  • For string type, character limit is 1024 characters.

  • For number type, a maximum of 15 integer digits and 6 decimal places are supported.

Example

Disabling automaticScreenTracking

By default, automaticScreenTracking is enabled in the SDK. If you do not want automatic screen information collection at the Activity/ViewController level, you must disable automaticScreenTracking.

You can configure automaticScreenTracking when initializing the SDK.

Example

Last updated