herald_mixpanel 1.2.0
herald_mixpanel: ^1.2.0 copied to clipboard
A Herald vendor adapter that sends to Mixpanel: events, user profile and super properties.
Herald for Mixpanel #
Sends Herald events and properties to Mixpanel, over
mixpanel_flutter: events, the People profile and
super properties.
final mixpanel = await Mixpanel.init(
projectToken,
trackAutomaticEvents: false,
optOutTrackingDefault: true, // silent until consent
);
final tracker = MixpanelAnalyticsTrackerService(
eventTrackerFactory: CompositeMixpanelEventTrackerFactory([
ScreenViewMixpanelEventTrackerFactory(mixpanel),
GenericMixpanelEventTrackerFactory(mixpanel),
]),
propertySetterFactory: CompositeMixpanelPropertySetterFactory([
UserPropertyMixpanelPropertySetterFactory(mixpanel), // People profile: must come first
GenericMixpanelPropertySetterFactory(mixpanel), // super properties
]),
);
final service = MixpanelAnalyticsService(mixpanel);
Values keep their types. A UserProperty goes to the People profile and any other property
becomes a super property. Revoking consent flushes, then opts out.
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.