Package com.codename1.analytics
The analytics API tracks how your application is used in the field through a
generic provider SPI. Register one or more AnalyticsProvider
implementations with the Analytics facade and
report screen views, events, user properties and crashes; the facade fans
each call out to every provider once the relevant consent has been granted.
Built-in providers include the first-party
CodenameOneAnalyticsProvider (reporting into
the Codename One cloud, with capabilities gated by your subscription tier),
GoogleAnalyticsProvider (Google Analytics 4),
MatomoAnalyticsProvider (privacy-first, self
hostable), FirebaseAnalyticsProvider and the
LoggingAnalyticsProvider used in the
simulator and tests.
Consent is configurable and defaults to opt-in
(ConsentMode.OPT_IN): nothing is collected or
transmitted until the application records a choice via
Analytics.setConsent(com.codename1.analytics.AnalyticsConsent),
helping you comply with GDPR / CCPA. The pseudonymous client id is not
derived from any hardware identifier and can be cleared with
Analytics.resetClientId() to honour erasure
requests.
The previous AnalyticsService entry point is
retained, deprecated, and now delegates to this API.
-
ClassDescriptionConvenience base class for
AnalyticsProviderimplementations.The application-facing entry point for analytics.Enumerates the analytics features a provider (or a server-side subscription tier) may support.An immutable snapshot of the consent the user has granted, broken down by category so that an application can honour granular choices (for example allowing crash reporting while declining behavioural analytics).Mutable builder forAnalyticsConsent.Immutable bundle of ambient information shared with every provider throughAnalyticsProvider.init(AnalyticsContext).A crash / exception report routed to providers that advertiseAnalyticsCapability.CRASH_REPORTING.Mutable builder forAnalyticsCrashReport.An immutable analytics event: a named action with an optional category and an ordered set of parameters.Mutable builder forAnalyticsEvent.The analytics service provider interface (SPI).Deprecated.The Codename One first-party analytics provider.Controls the default behaviour ofAnalyticsbefore the application has recorded an explicit consent choice from the user.A provider that forwards analytics to the native Firebase Analytics SDK through theNativeFirebaseAnalyticsnative interface.A provider for Google Analytics 4 using the Measurement Protocol (v2).Bridges a legacyAnalyticsServicesubclass into the newAnalyticsProviderSPI so that custom analytics implementations written against the deprecated API can participate in theAnalyticsfacade alongside modern providers.A provider that simply logs every call (and records them in memory) instead of sending data anywhere.A privacy-first, non-Google provider targeting Matomo (formerly Piwik) through its HTTP Tracking API.Native bridge forFirebaseAnalyticsProvider.
Analyticsand anAnalyticsProvider