Viewing version 8.0.15. Open the latest package page.

unified_analytics

8.0.15

A package for logging analytics for all Dart and Flutter related tooling to Google Analytics.

Download archive

Readme

package:unified_analytics pub package package publisher

What's this?

This package is intended to be used on Dart and Flutter related tooling only. It provides APIs to send events to Google Analytics using the Measurement Protocol.

This is not intended to be general purpose or consumed by the community. It is responsible for toggling analytics collection for related tooling on each developer's machine.

Using this package

Refer to the usage guide.

Changelog

8.0.15

  • Added IDE and plugin information to Event.serverSession.
  • Discard any Exception or Error thrown while reading or writing analytics logs.
  • Added agent parameter to Analytics constructors to track the AI coding assistant/agent executing the tool.

8.0.14

  • Added HCPP related analytics to Event.commandUsageValues.

8.0.13

  • Added DashEnvVar utilities for environment variable handling.

8.0.12

  • Require Dart 3.10
  • Added success indicator and label to Event.flutterTrackAndroidDependencies

8.0.11

  • Added Event.flutterTrackAndroidDependencies to track android dependencies.
  • Deprecated Event.flutterWasmDryRun in favor of Event.flutterWasmDryRunPackage.
  • Added Event.plugins to track new analyzer plugins
  • Added DashEvent.ideEvent to track IDE reported events.

8.0.10

  • Added Event.flutterWasmDryRunPackage to track dart2wasm dry run metrics from Flutter including public package information.

8.0.9

  • Added libraryDiagnosticsBundleFailures to Event.analysisStatistics.

8.0.8

  • More data for Event.analysisStatistics for events from Dart Analysis Server.

8.0.7

  • Added optional fields contextWorkspaceType and numberOfPackagesInWorkspace to Event.contextStructure for workspace and packages distribution from the Dart Analysis Server.
  • Removed Event.contextStructure optional fields contextsFromBothFiles, contextsFromOptionsFiles,contextsFromPackagesFiles,contextsWithoutFiles.

8.0.6

  • Added Event.analysisStatistics for events from Dart Analysis Server, about analysis.

8.0.5

  • Fix Event.flutterWasmDryRun fields.

8.0.4

  • Changed Event.flutterWasmDryRun to track dart2wasm dry run metrics from Flutter.

8.0.3

  • Changed Event.contextStructure to make optional data that's no longer being collected and to add data about the size of library cycles.

8.0.2

  • Added Event.dartMCPEvent for events from the dart mcp-server command.

8.0.1

  • Added Event.flutterInjectDarwinPlugins event for plugins injected into an iOS/macOS project.

8.0.0

  • Send enabled_features as an event parameter in all events rather than as a user property.

7.0.2

  • Allow LogStatsFile to contain more granular event types (specifically property_editor events).

7.0.1

  • Fixed UnsupportedError thrown when Event.exception is called without providing a value for args.

7.0.0

  • Added a required parameter screen to the Event.devtoolsEvent constructor.
  • Added an optional parameter additionalMetrics to the Event.devtoolsEvent constructor.
  • Added CustomMetrics class for unified_analytics clients to define custom event metrics.
  • Removed parameters uiDurationMicros, rasterDurationMicros, shaderCompilationDurationMicros, traceEventCount, cpuSampleCount, cpuStackDepth, heapDiffObjectsBefore, heapDiffObjectsAfter, heapObjectsTotal, rootSetCount, rowCount, inspectorTreeControllerId, androidAppId, iosBundleId from the Event.devtoolsEvent constructor.

6.1.5

  • Remove any data entries with a null value in the Event.exception constructor.

6.1.4

  • Fix formatting and remove dependency on package:intl.
  • Remove direct usage of package:path in favor of package:file.
  • Added androidAppId and iosBundleId to the Event.devtoolsEvent constructor.

6.1.3

  • Require Dart 3.4.
  • Added isWasm parameter to the Event.devtoolsEvent constructor.
  • Added an optional parameter data to the Event.exception constructor.

6.1.2

  • Avoid opening large telemetry log files to prevent out of memory errors.

6.1.1

  • Fixed bug where calling Analytics.send could result in a FileSystemException when unable to write to a log file.

6.1.0

  • Added new event constructor Event.devtoolsEvent for the single devtools event with a new enum value DashEvent.devtoolsEvent

6.0.0

  • Consolidate Session functionality into UserProperty to prevent race condition crash where session logic crashed before initializing UserProperty
  • Get rid of late variables throughout implementation class, AnalyticsImpl
  • Any error events (Event.analyticsException) encountered within package will be sent when invoking Analytics.close; replacing ErrorHandler functionality
  • Exposing new method for FakeAnalytics.sendPendingErrorEvents to send error events on command
  • Added Event.fromJson static method to generate instance of Event from JSON
  • Remove unused parameters measurementId and apiSecret from the Analytics.test constructor
  • Remove Analytics.test factory constructor in favor of Analytics.fake static method to return a FakeAnalytics instance
  • Remove FakeAnalytics default constructor in favor of Analytics.fake

5.8.8

  • Bug fix rewrite the other call site for the session file

5.8.7

  • Bug fix to rewrite the last_ping key into the session json file

5.8.6

  • Refactored session handler class to use the last modified timestamp as the last ping value to prevent writing to file with each send
  • Bumping intl package to 0.19.0 to fix version solving issue with flutter_tools

5.8.5

  • Fix late initialization error for Analytics.userProperty bug

5.8.4

  • Exporting all enums from enums.dart through lib/testing.dart

5.8.3

  • Fix bug when parsing session json file

5.8.2

  • Added new event Event.analyticsException to track internal errors for this package
  • Redirecting the Analytics.test factory to return an instance of FakeAnalytics
  • Exposing new helper function that can be used to parse the Dart SDK version

5.8.1

  • Refactor logic for okToSend and shouldShowMessage
  • Check devtools config file for legacy opt out status

5.8.0

  • Fix template string for consent message
  • Add enabledFeatures to constructor to collect features enabled for each dash tool

5.7.0

  • Added the Event.commandUsageValues constructor

5.6.0

  • Added the Event.timing constructor

5.5.0

  • Edit to the Event.flutterCommandResult constructor to add commandHasTerminal
  • Added timeout for Analytics.setTelemetry to prevent the clients from hanging
  • Added the Event.appleUsageEvent constructor
  • Added the Event.exception constructor

5.4.0

  • Added the Event.codeSizeAnalysis constructor

5.3.0

  • User property "host_os_version" added to provide detail version information about the host
  • User property "locale" added to provide language related information
  • User property "client_ide" (optional) added to provide the IDE used by the Dash tool using this package, if applicable
  • Added the Event.flutterCommandResult constructor

5.2.0

  • Added the Event.hotRunnerInfo constructor

5.1.0

  • Added the Event.flutterBuildInfo constructor

5.0.0

  • Update to the latest version of package:dart_flutter_team_lints
  • Using internal futures list to store send events
  • Added the Event.doctorValidatorResult constructor

4.0.1

  • Adding constant for the NoOpAnalytics instance client ID to enable clients to reference it in tests

4.0.0

  • Enhanced LogFileStats data to include information about flutter channel counts and tool counts
  • Added new method to suppress telemetry collection temporarily for current invocation via analytics.suppressTelemetry()
  • Added SurveyHandler feature to Analytics instance to fetch available surveys from remote endpoint to display to users along with functionality to dismiss them
  • Surveys will be disabled for any users that have been opted out
  • Shipping FakeAnalytics for clients of this tool that need to ensure workflows are sending events in tests
  • Adding getter to Analytics instance to fetch the client ID being sent to GA4

3.0.0

  • Allow latest package versions for file and http
  • Introducing new Event class that will standardize what event data can be sent with each event
  • Deprecating the sendEvent method in favor of the send method

2.0.0

  • Refactoring dateStamp utility function to be defined in utils.dart instead of having static methods in Initializer and ConfigHandler
  • Remove the pddFlag now that the revisions to the PDD have been finalized to persist data in the log file and session json file
  • Opting out will now delete the contents of the CLIENT ID, session json, and log files; opting back in will regenerate them as events send
  • enableAsserts parameter added to constructors for Analytics to check body of POST request for Google Analytics 4 limitations
  • Now checking if write permissions are enabled for user's home directory, if not allowed, NoOpAnalytics returned by Analytics factory constructor

1.1.0

  • Added a okToSend getter so that clients can easily and accurately check the state of the consent mechanism.
  • Initialize the config file with user opted out if user was opted out in legacy Flutter and Dart analytics

1.0.1

  • Error handling on the analytics.sendEvent(...) method to silently error out and return a 500 http status code to let tools using this package know Google Analytics did not receive the event (all successful requests will have a status code of 2xx provided by Google Analytics)

1.0.0

  • Error handling functionality added to prevent malformed session json data from causing a crash
  • Creating a new analytics constructor to point to a test instance of Google Analytics for developers
  • Align supported tool list with PDD
  • Exposing a new instance method that will need to be invoked when a client has successfully shown the consent message to the user clientShowedMessage()
  • Adding and incrementing a tool's version will automatically use the current consent message version instead of incrementing by 1
  • Default constructor has disabled the usage of local log file and session json file until revisions have landed to the privacy document

0.1.2

  • Implemented fake Google Analytics Client for Analytics.test(...) constructor; marked with visible for testing annotation

0.1.1

  • Bumping intl package to 0.18.0 to fix version solving issue with flutter_tools
  • LogFileStats includes more information about how many events are persisted and total count of how many times each event was sent

0.1.0

  • Initial version

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'unified_analytics:8.0.15'
pubspec.yaml
name: unified_analytics
description: >-
  A package for logging analytics for all Dart and Flutter related tooling
  to Google Analytics.
# LINT.IfChange
# When updating this, keep the version consistent with the changelog and the
# value in lib/src/constants.dart.
version: 8.0.15
# LINT.ThenChange(lib/src/constants.dart)
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics

environment:
  sdk: ^3.10.0

dependencies:
  clock: ^1.1.1
  convert: ^3.1.1
  file: '>=6.1.4 <8.0.0'
  http: '>=0.13.5 <2.0.0'
  meta: ^1.9.0
  platform: ^3.0.0

dev_dependencies:
  dart_flutter_team_lints: ^3.0.0
  test: ^1.16.6
  yaml: ^3.1.1

Version history

VersionPublishedArchiveSHA-256
0.1.0-devOn demandDownload520b60bc…55fd51
0.1.0On demandDownload19e8b599…bb91c5
0.1.1On demandDownloadbf06f392…6a15d0
0.1.2On demandDownloadbeb5964b…d7fd74
1.0.0On demandDownloadbc32db65…d57092
1.0.1On demandDownload4c2d5bb0…0fd94f
1.1.0On demandDownload55b6feec…5fbe60
2.0.0On demandDownload4f9f29e5…624298
3.0.0On demandDownload4d22115b…a9e4b8
4.0.0On demandDownload5394c375…2c0c11
4.0.1On demandDownloadc51b6065…8afc16
5.0.0On demandDownload7625d3b0…8737de
5.1.0On demandDownloadd1279d22…fa6aa6
5.2.0On demandDownload20a88464…94abb5
5.3.0On demandDownloada106d77a…e54b64
5.4.0On demandDownload23af45dc…13634b
5.5.0On demandDownloada84bcf16…971a7e
5.6.0On demandDownload241cf4c9…043bd4
5.7.0On demandDownloadd322657a…d747a9
5.8.0On demandDownloadfbcb0ad8…4c77f8
5.8.0+1On demandDownload18204ce6…f280c1
5.8.1On demandDownloada6701ca1…4a7823
5.8.2On demandDownload3beb6caa…6628fb
5.8.3On demandDownload1d624d97…4871be
5.8.4On demandDownloada4fb5c59…d54205
5.8.5On demandDownload395e9e8e…f3d730
5.8.6On demandDownload78dc929d…d3ee2e
5.8.7On demandDownload6c35c201…798a85
5.8.8On demandDownload252a0b8d…877c01
5.8.8+1On demandDownload57f594f2…7dba6b
5.8.8+2On demandDownload099bb7f0…ee4c9b
6.0.0On demandDownload468f4ba1…e11374
6.1.0On demandDownload0271998b…dfff0e
6.1.1On demandDownload40745b6e…1daecc
6.1.2On demandDownload916215af…557d2d
6.1.3On demandDownloadf9aa7d6c…4e5681
6.1.4On demandDownload9f3c68cb…be46df
6.1.5On demandDownload4aa2a75f…3c25d3
6.1.6On demandDownloada1005369…021f9b
7.0.0On demandDownloadcd1e6a4e…49740f
7.0.1On demandDownloadb85c6ace…3172da
7.0.2On demandDownloadd581cd70…c31d05
8.0.1On demandDownloadc8abdcad…c95590
8.0.2On demandDownload7bb975f2…44e51b
8.0.4On demandDownload4403d39a…35ee44
8.0.5On demandDownload8d1429a4…70b53d
8.0.10On demandDownloadce091b2b…828a23
8.0.11On demandDownloadd86b8227…ad818d
8.0.12On demandDownload18b5efde…debc68
8.0.14On demandDownload406724e9…b8f3b9
8.0.15Cached · Upstream SHA-256 matchedDownload0988c50d…eb0776
8.0.16On demandDownload0917e37f…fb0e21
8.0.17On demandDownload649456e9…20459e
8.0.18On demandDownload28bb11ef…2c719b
8.1.0On demandDownload1dbbb315…b67a58
8.2.0On demandDownload4774afb4…29edef
8.3.0Cached · Upstream SHA-256 matchedDownloadf4405e1c…e04dbc

Dependencies

clock "^1.1.1"

convert "^3.1.1"

file "\u003e=6.1.4 \u003c8.0.0"

http "\u003e=0.13.5 \u003c2.0.0"

meta "^1.9.0"

platform "^3.0.0"