analytics_exa_flutter 1.5.3
analytics_exa_flutter: ^1.5.3 copied to clipboard
Package de analytics.
analytics_exa_flutter #
Overview #
Analytics Exa is a Flutter project that provides a flexible and extensible analytics solution for your mobile applications. It supports various analytics providers, including Firebase Analytics, Inngage, AppFlyer, and Amplitude.
Initial Configuration #
To get started with Analytics Exa, follow these steps:
1. Installation #
Add the Analytics Exa package to your pubspec.yaml file:
dependencies:
analytics_exa:
Then, run:
flutter pub get
2. Initialize Analytics #
In your application, initialize the ExaAnalytics class with the desired analytics providers. You can do this in your main.dart file or any other appropriate location.
import 'package:analytics_exa/analytics_exa.dart';
void main() {
ExaAnalytics().init(
inngageProps: InngageProps(
// Inngage specific configuration
),
appFlyerProps: AppFlyerProps(
// AppFlyer specific configuration
),
amplitudeProps: AmplitudeProps(
// Amplitude specific configuration
),
);
// Continue with your app initialization...
}
Usage #
Once you have initialized Analytics Exa, you can start using the analytics features throughout your application.
Set Current Screen #
await ExaAnalytics().setCurrentScreen(
screenName: 'HomeScreen',
screenClassOverride: 'CustomHomeScreenClass',
);
Log Event #
await ExaAnalytics().setLogEvent(
params: {'param1': 'value1', 'param2': 'value2'},
eventName: 'CustomEvent',
);
Log User ID #
await ExaAnalytics().setLogUserId(id: 'user123');
Log User Properties #
await ExaAnalytics().setLogUserProperties(
name: 'UserName',
value: 'John Doe',
customFields: {'customField1': 'value1', 'customField2': 'value2'},
);
Set Default Event Parameters #
await ExaAnalytics().setDefaultEventParameters(
parameters: {'defaultParam1': 'value1', 'defaultParam2': 'value2'},
);
Updating Analytics Providers #
You can update individual analytics providers by calling the respective update methods:
Update Inngage #
ExaAnalytics().inngageUpdate(
inngageProps: InngageProps(
// Updated Inngage configuration
),
);
Update AppFlyer #
ExaAnalytics().appsFlyerUpdate(
appFlyerProps: AppFlyerProps(
// Updated AppFlyer configuration
),
);
Update Amplitude #
ExaAnalytics().amplitudeUpdate(
amplitudeProps: AmplitudeProps(
// Updated Amplitude configuration
),
);
Customizing Analytics Providers #
You can customize the analytics providers used by Analytics Exa during initialization. Simply provide the desired configuration for each analytics provider in the init method.
ExaAnalytics().init(
inngageProps: InngageProps(
// Inngage specific configuration
),
appFlyerProps: AppFlyerProps(
// AppFlyer specific configuration
),
amplitudeProps: AmplitudeProps(
// Amplitude specific configuration
),
);
Note: Make sure to consult the documentation of each analytics provider for specific configuration details.
Conclusion #
Analytics Exa simplifies the integration of analytics into your Flutter project, offering flexibility and support for various analytics providers. Feel free to explore additional features and customize the integration based on your specific requirements.