Last updated:
0 purchases
opus tracking
opus_tracking #
opus_tracking
Opus Tracking is a Flutter package that provides utilities for integrating tracking and analytics features into your Flutter applications. With Opus Tracking, you can easily track user interactions, events, and behaviors within your app to gain insights and improve user experience.
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
opus_tracking: ^0.1.5
copied to clipboard
Usage #
Setup #
Please following detail usage in example.
Import the package wherever you need it.
import 'package:opus_tracking/opus_tracking.dart';
copied to clipboard
Add the root component, create a global EventClient
EventClient eventClient = EventTrackingFactory.create(
tenantId: 'your-tenant-id',
apiKey: 'your-api-key',
source: 'your-application-source',
apiDomain: 'your-api-domain'
);
copied to clipboard
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'
)
);
copied to clipboard
and if you go back, please call:
eventClient.removeScreenName();
copied to clipboard
Additional functions
If you want to use a custom config, please pass it as a 'config' param:
EventClient eventClient = EventTrackingFactory.create(
tenantId: 'your-tenant-id',
apiKey: 'your-api-key',
config: {
'common_properties': {
'user_id': 'user_id',
},
'source': 'source',
}
);
copied to clipboard
Also, you can use some function that can be custom you tracking event:
eventClient.setApiDomain('your-api-domain');
eventClient.setApiKey('your-api-key');
eventClient.setBasicInfo({
'domain': 'your-domain'
});
eventClient.setIsAuthenticated(true);
copied to clipboard
Tracking event #
Click tracking
IClickParams params = IClickParams(additionalData: {});
eventClient.logClickEvent('your-button-ui-key', params: params);
copied to clipboard
Screen tracking
IScreenParams params = IScreenParams(additionalData: {});
eventClient.logScreenEvent('screen-name', params: params);
copied to clipboard
Behavior tracking
dynamic params = {};
eventClient.logBehaviourEvent('behavior-name', params: params);
copied to clipboard
Handling Exceptions #
tenantId must not be empty
copied to clipboard
tenantId must not be ""
apiKey must not be empty
copied to clipboard
apiKey must not be ""
apiDomain must not be empty
copied to clipboard
apiDomain must not be ""
source must not be empty
copied to clipboard
source must not be ""
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.