opus_tracking 0.0.7 copy "opus_tracking: ^0.0.7" to clipboard
opus_tracking: ^0.0.7 copied to clipboard

@opus/tracking

opus_tracking #

opus_tracking

OPUS Tracking package

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  opus_tracking: ^0.0.7

Usage #

Setup #

Import the package wherever you need it.

import 'package:opus_tracking/shelf.dart';

Please following detail usage in example

Add the root component, create a global EventClient

EventClient eventClient = EventTrackingFactory.create(
        tenantId: 'your-tenant-id', apiKey: 'your-api-key');
eventClient.setSource('your-source');

With setSource function please provide your name of source (ex: mobile, web, ...).

In your navigate function, if you enter the other screen, please call:

eventClient.addScreenName(IScreen(uiKey: generateRandomString(10), name: 'your-screen-name'));

and if you go back, please call:

eventClient.removeScreenName();

Tracking event #

Click tracking

IClickParams params = IClickParams(additionalData: {});
eventClient.logClickEvent('your-button-ui-key', params: params);

Screen tracking

IClickParams params = IClickParams(additionalData: {});
eventClient.logScreenEvent('screen-name', params: params);