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

Screen Tracking

For screen navigation in Flutter, refer to the Flutter developer documentation below.

Because Flutter fundamentally uses a single Activity/ViewController architecture, it is difficult to automatically collect screen information.

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

setCurrentScreen

This feature is supported in Flutter SDK 2.28.0 and above.

Use the setCurrentScreen(screen) method to track screens.

  • The minimum time unit for Screen Tracking is 1 second.

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

Parameter
Type
Required
Description

name

string

Required

The name of the current screen.

className

string

Required

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

Example

It is recommended to call setCurrentScreen inside route change detection methods such as didPush and didPop of NavigatorObserver.

Property

The Hackle SDK supports adding properties to an Event object.

  • You can add a maximum of 64 properties per event object.

Category
Type
Constraints

Property Key (key)

string

Maximum 128 characters.

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

Property Value (value)

boolean, string, number, array

For string type, maximum 1024 characters.

For number type, up to 15 integer digits and up to 6 decimal places are supported.

Example

Disabling automaticScreenTracking

The SDK has automaticScreenTracking enabled by default. If you do not want to track MainActivity and ViewController, you must disable automaticScreenTracking.

You can configure automaticScreenTracking when initializing the SDK.

Example

Last updated