MoEngage Analytics Implementation
What you'll learn
- Generating the MoEngage vendor implementation
- Completing the required native-level SDK setup
- Configuring your App ID via
app_configand registering the module
Prerequisites
- Analytics SDK installed in your monorepo
- A MoEngage account — copy your App ID from the MoEngage dashboard → Settings → App Settings
- Native SDK configured for Android and iOS (see Step 2)
Step 1: Generate the Brick
archipelago generate moengage_analytics_implYou will be prompted for:
- appName —
MyApp(must match your monorepo app name) - isForMonorepo —
true
The brick is generated into infrastructure/moengage_analytics_impl/.
Step 2: Complete Native SDK Setup
Important: MoEngage requires native-level initialisation that cannot be done from Dart alone. Follow the official guide before proceeding: MoEngage Flutter SDK Setup
This covers adding the MoEngage dependency to your android/build.gradle and ios/Podfile, and calling the platform-level initialize() in MainActivity / AppDelegate.
Step 3: Add the App ID to app_config
Open your app_config package and add the App ID to AppEnv:
// lib/src/app_env.dart
class AppEnv {
// existing fields …
final String moengageAppId; // from MoEngage → Settings → App Settings
}Populate the value for each environment (dev, staging, prod).
Step 4: Register the Module and Verify
import 'package:moengage_analytics_impl/moengage_analytics_impl.dart';
await initMoEngageAnalyticsImplModule(getIt);The implementation is registered as @Named(AnalyticInjectorKey.moEngageImpl) and is picked up automatically by the analytics_sdk orchestrator via getIt.getAll<AnalyticVendor>().
Key behaviours to know:
- Event parameters — built with
MoEPropertiesusingaddAttribute(key, value). - User ID —
identifyUser(userId)is called when you callsetUserId. - User properties — set via
setUserAttribute(key, value). - Logout —
logout()is called to reset the identity.
Trigger a tracked event and verify it appears in the MoEngage dashboard → Analytics → Event Analytics.
Next Steps
- Set up the Analytics SDK for the full multi-vendor architecture