herald_amplitude 1.0.0-dev.1
herald_amplitude: ^1.0.0-dev.1 copied to clipboard
A Herald vendor adapter that sends to Amplitude: events, user properties, screen views and revenue.
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 #
The Herald website has the guides, and the repository has the other packages and an example app.