Herald for Amplitude
Sends Herald events and properties to Amplitude, over
amplitude_flutter: events, user properties,
screen views and revenue.
final amplitude = Amplitude(
Configuration(
apiKey: apiKey,
optOut: true, // silent until consent
autocapture: const AutocaptureOptions(screenViews: false), // Herald sends screen views
),
);
final tracker = AmplitudeAnalyticsTrackerService(
eventTrackerFactory: CompositeAmplitudeEventTrackerFactory([
ScreenViewAmplitudeEventTrackerFactory(amplitude),
GenericAmplitudeEventTrackerFactory(amplitude),
]),
propertySetterFactory: CompositeAmplitudePropertySetterFactory([
GenericAmplitudePropertySetterFactory(amplitude),
]),
);
final service = AmplitudeAnalyticsService(amplitude);
Values keep their types. A ScreenViewEvent becomes [Amplitude] Screen Viewed, and purchases go
through AmplitudeRevenueEvent and RevenueAmplitudeEventTracker, deduplicated by insertId.
Amplitude forgets the opt-out between launches, so re-apply the stored answer after start().
Documentation
It works with herald, the core, whose page lists every Herald
package. The Herald website has the guides, and
the repository has an example app.
Libraries
- herald_amplitude
- Sends Herald events and properties to Amplitude. See the package README for the setup.