NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev
Type-safe analytics event tracking with code generation from YAML configuration. Supports multiple providers, testing utilities, and export formats.
Latest stable
2.3.0
Last release 28 days ago
25 Oct 2026
Release timing varies
gaps range from 9 days to 3 months
Nearly every release is documented
notes for 26 of 26 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
29 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
ensureAnalyticsInitialized and BatchingAnalytics.startFlushForTest are deprecated.
Fixes generated code that did not compile, clearer errors for tracking plan mistakes, and sturdier runtime services. The full list is in the changelog.
Check these before upgrading. Most turn a silent mistake into an error:
naming.casing, a shared reference with no definition, an invalid regex, and length or range rules on the wrong type now fail instead of passing silently.audit and studio_export reject generation flags such as --watch.sqlite3 is installed but fails, generation fails.source_path relative to the project root.BatchingAnalytics and MultiProviderAnalytics log failures without a callback to the console; pass logger to change that.New: warnings for unknown fields in the tracking plan, BatchingAnalytics.maxQueueSize, and shared parameters referenced by their key. ensureAnalyticsInitialized and BatchingAnalytics.startFlushForTest are deprecated.
Most of these turn a silent mistake into an error. Check them before upgrading:
naming.casing value, such as titleCase, now stops generation and lists the accepted values. Before, it silently fell back to snake_case.name: with no shared parameter of that name now fails to parse. Before, it generated required null name, which did not compile.regex that does not compile, a length rule (min_length, max_length, regex) on a non-string type, and a range rule (min, max) on a non-numeric type now fail to parse. Before, they produced code that did not compile or threw in the app.audit and studio_export reject generation flags such as --watch or --docs. Before, they accepted and ignored them.sqlite3 is installed but cannot build the database, generation fails with its error. Before, it reported success and left an empty database.source_path relative to the project root (events/auth.yaml) instead of an absolute path.BatchingAnalytics and MultiProviderAnalytics write failures that have no callback to the console through a ConsoleLogger. Pass logger to send them elsewhere. In debug builds, a failed flush no longer throws an AssertionError in place of the delegate's error.regex switch from r'...' to r'''...''', the form events already use.paramters: or allowed_value:, log a warning with the file, line and column. Generation continues.BatchingAnalytics takes an optional maxQueueSize that drops the oldest events while the provider is unreachable, and a logger. Every dropped event, including one logged after dispose(), goes to onEventDropped.param_name can be referenced by its key in the shared file as well as by that name, matching the Studio.audit and studio_export have their own --help and options.$, backslashes and line breaks in YAML values no longer break the generated Dart: enum values, wire names from param_name, context names, replacement, multi-line descriptions and regex patterns are escaped.Email, email) report a collision instead of generating two identical enum constants.identifier: overrides no longer produce undefined variables.dart_type parameters no longer generate a ?. that the analyzer reports as a warning.description: 42, min: "1") is reported by name at the value, in event, context and shared parameter files alike. In context and shared files it used to crash with a raw TypeError.line 3, column 18 of events/auth.yaml), and a YAML syntax error is reported once instead of twice.naming fields, a naming value that is not a map, a config file with only comments, and a config file whose root is a list are reported clearly.--verbose, a stack trace is printed only for unexpected failures, not for mistakes in the tracking plan, config or command line.event_name_template is quoted and the regex example no longer uses an invalid escape.audit and the Studio export read the tracking plan the same way generation does, including shared parameters, contexts and glob event paths.git blame in the events file's repository, so it shows last-modified details regardless of the current directory.bool, boolean) as the same type, reports dart_type changes and narrowed allowed_values as breaking, and reports widened allowed_values as non-breaking.BatchingAnalytics.dispose() delivers events that a failed automatic flush put back in the queue, instead of throwing and losing them.MultiProviderAnalytics, or a provider that throws before returning a future, is reported through onProviderFailure and no longer stops delivery to the other providers.ensureAnalyticsInitialized is deprecated: the generated Analytics.instance performs the check. It will be removed in the next major release.BatchingAnalytics.startFlushForTest is deprecated in favour of flush().sync.sh, and sync.sh now fails when the type check or Studio tests fail.fake_async instead of real waits, and the CLI commands run in process. Line coverage of lib/ rose from 93.6% to 95.8%.schema/*.json.Your coding agent can read these notes before it upgrades. Set up the MCP server →
chore(release): prepare 2.2.2
chore(release): prepare 2.2.2
analyzer constraint to >=7.7.1 <15.0.0. Projects on Dart 3.10+ need a newer analyzer for build_runner, freezed, and drift_dev, and the previous ^7.7.1 pin blocked their resolution. Projects that stay on analyzer 7 resolve as before.Added analytics-gen-yaml-schema, a package skill for AI agents creating, updating, and validating YAML tracking plans.
Added analytics-gen-yaml-schema, a package skill for AI agents creating, updating, and validating YAML tracking plans.
Install it from your application directory after upgrading to analytics_gen 2.2.1:
dart run skills@ get -p analytics_gen -s analytics-gen-yaml-schema
The Dart API is unchanged.
analytics-gen-yaml-schema package skill for AI agents creating, updating, and validating YAML tracking plans. Install it from an application that depends on analytics_gen with dart run skills@ get -p analytics_gen -s analytics-gen-yaml-schema.Studio remembers your project file — after a reload the Studio reconnects to the last opened analytics-studio.json (Chrome/Edge, via the File System A
analytics-studio.json (Chrome/Edge, via the File System Access API) and remembers the file name on every browser, so you no longer re-open it each session. Save writes straight back to the same file; data is auto-saved locally regardless.analytics-studio.json now carries a meta block with a stable projectId, an optional name, and a content revision hash. The revision is deterministic and timestamp-free, so CI can compare project files across commits to detect analytics changes. The Dart studio target emits the same meta and preserves projectId across regenerations..json and ZIP file names) and optionally append the content-revision hash for unique CI-artifact names, via the new "Project…" dialog (which also shows the project ID and revision).analytics-studio.json changes on disk (an external edit, a git pull, a CI regeneration), the Studio offers to reload it instead of silently diverging (Chrome/Edge).revision hash (cyrb53 over canonical, key-sorted JSON) implemented in both the Studio (project-meta.ts) and the Dart generator (project_revision.dart), locked by a parity test so a studio-saved and a CI-generated file agree for identical content.Studio export as a first-class generation target — added targets.studio (with outputs.studio path) to analytics_gen.yaml. The Studio project file is n
targets.studio (with outputs.studio path) to analytics_gen.yaml. The Studio project file is now produced by the main pipeline alongside Dart code, docs, and exports.--studio CLI flag for dart run analytics_gen:generate. CLI flags follow the same precedence as --docs / --exports: explicit flag wins over config, with --no-studio to disable.generate_studio and studio_path are accepted at the root of the config for parity with other targets.parameters block (allowed by schema) no longer crash the import. YAML and JSON import paths share the same normalization logic.StudioGenerator so the standalone analytics_gen:studio_export binary and the main pipeline use the same zero-knowledge YAML reader.Analytics Gen Studio — web-based visual editor for analytics configuration, events, shared parameters, and contexts with real-time YAML preview.
schema/ now drive everything: Studio UI, TypeScript types, YAML templates, and documentation.Added boolean as an alias for bool type across type mapping, parsing, and documentation generation.
boolean as an alias for bool type across type mapping, parsing, and documentation generation.meta.auto_tracking_creation_date config option.
.analytics_tracking.json ledger file that records an ISO 8601 timestamp (yyyy-MM-ddTHH:mm:ss) when each event is first seen.tracking_creation_date value is automatically injected into each event's meta field during generation.analytics_gen.yaml and should be committed to version control.meta.include_meta_in_parameters config option to include event meta fields in the generated eventParameters map sent to analytics providers (e.g. Amplitude, Mixpanel). Default: false.Added dartReservedWords to StringUtil to prevent enum member name collisions with Dart keywords.
dartReservedWords to StringUtil to prevent enum member name collisions with Dart keywords.Export generated events from the analytics class renderer for easier access
Add include_event_description config option to optionally include an event's description property inside the emitted logger.logEvent parameters map. T
include_event_description config option to optionally include an
event's description property inside the emitted logger.logEvent
parameters map. This flag defaults to false to preserve existing
behavior; enable it via analytics_gen.yaml (key: include_event_description).
'description' key for events that
have a non-empty description when the flag is enabled.README.md were updated to document this flag.event_name strings
event_name using
{parameter_name} and the code generator will replace them with
Dart string interpolation in generated methods (for example,
"Screen: {screen_name}" → "Screen: ${screenName}").event_name still appears unchanged in docs/exports so
metadata remains stable across teams and exports.NamingStrategy._toTitleCase stripping structural punctuation (e.g. :) from event_name_template. Previously, using casing: title_case with a template like "{domain}: {event}" produced "Chat Under Dev Sheet Shown" instead of "Chat: Under Dev Sheet Shown". Only _ and - are now treated as word boundaries.Added templates/analytics_gen.yaml as a reference for all configuration options.
templates/analytics_gen.yaml as a reference for all configuration options.templates/events.yaml demonstrating event and parameter definitions.analytics_gen documentation.Introduced CapabilityProviderBase to replace CapabilityProviderMixin (deprecated).
CapabilityProviderBase to replace CapabilityProviderMixin (deprecated).--metrics flag to track generation performance.EventLoader now supports glob patterns (e.g., events/**/*.yaml).doc/PERFORMANCE.md, doc/TROUBLESHOOTING.md, doc/TESTING.md.Full Changelog: https://github.com/yelmuratoff/analytics_gen/compare/v1.0.1...v1.0.4
CapabilityProviderBase to replace CapabilityProviderMixin (deprecated).--metrics flag to track generation performance.EventLoader now supports glob patterns (e.g., events/**/*.yaml).doc/PERFORMANCE.md, doc/TROUBLESHOOTING.md, doc/TESTING.md.BatchingAnalytics where queue would stall after failed auto-flush.ConfigParser crash when optional fields are explicitly null.CapabilityRegistry now throws StateError on duplicate capability keys.BatchingAnalytics and MultiProviderAnalytics.Added "Dead Event" Audit Command (dart run analytics_gen:audit).
dart run analytics_gen:audit).test_matchers target to generate typed package:test matchers.dart_type parameter option to map parameters to existing Dart types.imports configuration for including external types.casing: snake_case, title_case, original).const maps for constant event parameters.test_matchers.Nothing published for this version
Enhanced SQL/CSV/JSON export formats with additional metadata.
AnalyticsParameter and AnalyticsDomain models.Enhance SQL generator with additional event and parameter metadata, sorting, and utility functions for improved data representation.
ParameterParser and its tests, consolidating parameter parsing logic into shared components.AnalyticsParameter and AnalyticsDomain models.Full Changelog: https://github.com/yelmuratoff/analytics_gen/compare/v1.0.0...v1.0.1
Add new documentation files and configure pubspec for API reference links and dartdoc inclusion.
Full Changelog: https://github.com/yelmuratoff/analytics_gen/compare/v0.2.1...v1.0.0
Nothing published for this version
Nothing published for this version
Note: The old flat structure is deprecated but may still work for some fields during a transition period, though migration is strongly recommended. ev…
analytics_gen.yaml file has been completely restructured into logical groups (inputs, outputs, targets, rules) to improve readability and organization.
# Old (v0.2.0)
analytics_gen:
events_path: events
output_path: lib/src/analytics
docs_path: docs/analytics.md
generate_docs: true
strict_event_names: true
event_parameters_path: events/shared.yaml
# New (v0.2.1)
analytics_gen:
inputs:
events: events
shared_parameters:
- events/shared.yaml
outputs:
dart: lib/src/analytics
docs: docs/analytics.md
targets:
docs: true
rules:
strict_event_names: true
event_parameters_path is strictly removed in favor of inputs.shared_parameters.Analytics.reset()).BatchingAnalytics.flush() behavior and updated README guidance.doc/VALIDATION.md.shared_parameters.
null).enforce_centrally_defined_parameters.prevent_event_parameter_duplicates.regex, min_length, max_length, min, max with runtime checks.PiiRenderer + Analytics.sanitizeParams).allowed_values.BaseRenderer to share common rendering logic across generators.GenerationTelemetry + implementations) integrated into CodeGenerator.SchemaValidator extracted from YamlParser with tests.YamlParser refactored to use loadYamlNode and enforces strict event-name rules.ignore_for_file lints and generation timestamp to generated files.Analytics.reset() for testing and hot-restart scenarios.Full Changelog: https://github.com/yelmuratoff/analytics_gen/compare/v0.2.0...v0.2.1
inputs, outputs, targets, rules).# Old → New
events_path → inputs.events
output_path → outputs.dart
docs_path → outputs.docs
event_parameters_path → inputs.shared_parameters
shared_parameters config.regex, min_length, max_length, min, max.allowed_values.Analytics.reset() for testing and hot-restart scenarios.Optimized generator performance with parallel processing and smart I/O.
meta) in YAML, propagated to code and exports.BatchingAnalytics for buffering events and AsyncAnalyticsAdapter for heavy providers.strict_event_names to prevent high-cardinality anti-patterns.Full Changelog: https://github.com/yelmuratoff/analytics_gen/compare/v1.0.6...v0.2.0
meta key-value pairs in YAML.BatchingAnalytics and AsyncAnalyticsAdapter.strict_event_names to prevent high-cardinality.Add include_event_description config option to optionally include an event's description property inside the emitted logger.logEvent parameters map. T
include_event_description config option to optionally include andescription property inside the emitted logger.logEventfalse to preserve existinganalytics_gen.yaml (key: include_event_description).
'description' key for events thatREADME.md were updated to document this flag.event_name strings
event_name using{parameter_name} and the code generator will replace them with"Screen: {screen_name}" → "Screen: ${screenName}").event_name still appears unchanged in docs/exports soinclude_event_description config option.event_name (e.g., "Screen: {screen_name}").- Full test coverage. - Added GitHub Actions CI.
Event deprecation lifecycle with deprecated + replacement.
--validate-only, --watch, --verbose, --plan.MultiProviderAnalytics with error isolation and onProviderFailure hook.deprecated + replacement.allowed_values for parameters with runtime validation.RecordedAnalyticsEvent for typed mock assertions.- Fix badge issues.
Refactor string interpolation in code generation.
- Minor updates and fixes.
- Minor updates and fixes.
- Initial release.
One column per month.