Skip to main content

pug_flutter 0.1.1 copy "pug_flutter: ^0.1.1" to clipboard
pug_flutter: ^0.1.1 copied to clipboard

Open-source product analytics SDK for Flutter: tracks app opens and installs, and screen views on Android and iOS, with identity, sessions and a consent gate.

0.1.1 #

  • pub.dev lists web support. lib/src/auto_properties.dart imported dart:io unconditionally, which kept web off the package's platforms though the SDK runs there; Platform now comes from a conditional import. Nothing changes at runtime.
  • The package description, topics, homepage, issue tracker and documentation links now say what the package is, for pub.dev search, and the README says which platforms get screen views.

0.1.0 #

  • Drop, with a warning, an event whose kind the server rejects: a kind may only contain letters, digits, _, . and -, so Order Completed or signup:started is dropped. Drop, with a warning, a property whose key starts with $, which is reserved for auto-properties, and send its event without it; and drop an auto-property from a custom PugAutoPropertyProvider whose key does not start with $. The server drops an event that breaks one of these rules, and before pug v0.0.55 it failed the whole batch, losing every event sent with the bad one.
  • Warn when the server accepts only part of a batch, with the count for each reason and, for each invalid event, its kind and the rules it broke. Those events used to be lost with no log.
  • Retry a batch whose 200 response isn't protobuf, such as a captive portal's sign-in page, as the Android and iOS SDKs do. It used to be committed as delivered, losing its events. An identify answered that way, or with a body that isn't its response, now fails with a log instead of counting as done, so the next identify still merges the anonymous profile.
  • The typed Pug.track.* methods take a Duration for the media and chat durations: position on videoPlay, videoPause, audioPlay and audioPause, fromPosition and toPosition on videoSeeked and audioSeeked, duration on chatCallLeft and muteDuration on chatMemberMuted. A Duration in props or extras is sent too. Each is sent as seconds, such as "90.5s", rounded to the millisecond, as the Android and iOS SDKs send it; it used to be dropped with a warning. WellKnownPropertyType has a new duration value, so an exhaustive switch over it needs a case for it.
  • On Linux, $deviceManufacturer and $deviceModel are no longer sent. They held the distribution's name from os-release, such as Ubuntu 24.04.1 LTS, rather than the hardware's.

0.0.8 #

  • app_install now carries installSource, as package_info_plus reports it: on Android the package name of the app that started the install, such as com.android.vending for Google Play, and on iOS com.apple, com.apple.testflight or com.apple.simulator, inferred from the App Store receipt path. It is left out when there is none, as with an adb install, on web and desktop, and with a custom PugAutoPropertyProvider.

0.0.7 #

  • Add PugOptions.httpClient to send the SDK's requests through any package:http client. They otherwise go through dart:io's HttpClient on Android, iOS, and desktop. Pass CupertinoClient (cupertino_http), CronetClient (cronet_http), or a client the app already configures. The app owns the client: the SDK never closes it, so the same one can be reused across Pug.destroy() and Pug.init(). It is ignored, with a warning, when a custom transport is also set.
  • Fix Flutter web, where no events were sent. Building each event read Platform.operatingSystem, which throws on web, so every track() call and every automatic event failed, and the default logger discarded the error.
  • On web, $os and $osVersion now come from the browser's user-agent client hints, read the way @pug-sh/browser reads them. They are omitted in browsers without client hints (Safari, Firefox).
  • Fix the UUIDv7 IDs generated on web. Compiled to JavaScript, their timestamp lost its top 16 bits, so event, session, device, and anonymous IDs did not sort by time.

0.0.6 #

  • Regenerate the protobuf code for the backend's cookieless contract. This alone changes nothing on the wire: the SDK never sets the new Event.cookieless flag and ignores the new BatchCreateResponse fields.
  • Pug.identify() now rejects an external ID that starts with cookieless-, which the server reserves for its own cookieless identities. As with other invalid input, the call is logged and completes without sending.
  • Discard a stored external ID that starts with cookieless-, left by an identify the server accepted before reserving the prefix, and drop queued events that carry it. Either would get event batches from the device rejected and dropped whole. The user is treated as anonymous until the next identify().
  • Errors the Pug facade catches (identify, reset, rotate, flush, destroy, and opting in or out) are now logged through the configured PugLogger instead of debugPrint.
  • Log a SharedPreferences write that reports false, which is how Android reports a failed commit, not only one that throws.
  • Stop quoting a corrupt stored value in the debug log, where a corrupt profile could expose an external ID.

0.0.5 #

  • Breaking: remove campaign capture, push device registration, and device subscription from the public API. The backend does not accept them yet, so shipping the entry points invited calls that could not succeed. The code stays in the package and the features will be turned back on in a later release.
    • package:pug_flutter/pug_flutter.dart no longer exports PugPush, PushProvider, PushSubscription, PushSubscribeOptions, PugLinkProvider, AppLinksPugLinkProvider, or campaignPropertiesFromUri.
    • PugOptions no longer has autoCaptureCampaigns or linkProvider, and no campaign auto-properties ($utmSource, $gclid, and the rest) are attached to events.
    • PugTransport no longer declares subscribeDevice; a custom transport does not have to implement it. It moved to an internal PugDeviceTransport that ConnectPugTransport still implements.
  • The notification_clicked, notification_received, and notification_dismissed event kinds are unaffected: they are ordinary events on the live events endpoint, still reachable through Pug.track.* and PugEventNames.
  • Add automatic app_install and app_update tracking, controlled by the new PugOptions.autoInstallEvents (default on, independent of autoTrack). app_install is emitted on the first launch the SDK sees on a device, and app_update (carrying previousVersion) on the first launch after the app version changes. Detection compares the $appVersion auto-property against a version persisted under __pug_<projectId>_last_version__, so it is inactive when a custom PugAutoPropertyProvider supplies no app version. The install event is suppressed when other Pug state is already on the device, so adding this SDK to an app that already used Pug does not report its existing users as new installs. Pug.destroy() clears that state, so a destroy/re-init cycle does look like a fresh install.

0.0.4 #

  • Add the $deviceType auto-property, reporting the form factor as tv, mobile, or desktop. Android TV is detected from the device's system features rather than the operating system, which reports plain android there; $platform stays android so the value keeps matching the other Pug SDKs. Omitted on web, where the host device is not detectable from Dart.
  • Fix $deviceModel shipping the literal "Unknown device"/"Unknown Model" placeholders that device_info_plus returns when its marketing-name lookup misses. Those now fall back to the device identifier (iPhone, MacBookPro18,3). macOS was affected on any Mac absent from the plugin's table, which previously had no placeholder check at all.
  • Omit $osVersion when the device-info payload has no version, instead of sending an empty string that overwrote the Platform.operatingSystemVersion fallback.
  • Derive $platform from Platform.operatingSystem instead of defaultTargetPlatform, so $platform and $os are one value from one source. No change to the value on any supported platform: this removes a lookup table, a debug-only spoofing vector, and a FlutterError that defaultTargetPlatform raises on targets outside its six-member enum.
  • Include the underlying error in the auto-property warning logs, which previously reported only that a category had failed.

0.0.3 #

  • Fix the $platform auto-property to send the cross-SDK lowercase value set: web, android, ios, macos, linux, windows, fuchsia. It previously came from defaultTargetPlatform.name, which keeps the enum's casing, so this SDK reported iOS/macOS where the rest of the Pug SDKs send ios/macos. The backend promotes $platform into a dedicated column verbatim, so the mismatch split one platform into per-SDK buckets in any cross-SDK breakdown.
  • Fix $platform on Flutter web, which reported the browser's host OS rather than web: a web app on an iPhone was indistinguishable from native iOS traffic. $platform is now always web there, and equals $os on every native target.
  • Document the auto-properties attached to every event in the README.

Dashboards, filters, or saved segments that match the old iOS/macOS casing (or that treated Flutter web traffic as iOS) need updating to the lowercase set.

0.0.2 #

  • Replace the connectrpc dependency with a hand-rolled native Connect unary transport over package:http. This drops the dependency_overrides: protobuf: ^6.0.0 workaround that 0.0.1 forced consumers to add: the SDK now resolves cleanly against the protobuf 6.x runtime the generated code requires. Connect error bodies are parsed for code/message; permanent codes drop the batch while transient/unknown errors (e.g. SocketException) retry.
  • Add a runnable example app under example/.

0.0.1 #

Initial release.

  • Analytics track API: untyped Pug.track('kind', props: {...}) plus codegen'd typed Pug.track.<event>(...) methods for well-known events, with compile-time checking of required fields and value types.
  • Identity, sessions, and device registration: init, identify, reset, rotate, flush, and async destroy() (awaits a best-effort final flush before teardown; the singleton detaches synchronously so a follow-up init() is safe).
  • identify() first-call anonymous-ID merge and device-ID linking. identify() never throws; init() throws synchronously only on invalid input (empty projectId/apiKey) and otherwise logs and swallows setup failures.
  • Batched binary-protobuf transport over Connect with lock/commit/rollback queue persistence; offline/transient failures retry, permanent failures drop.
  • Tracking-consent gate (opt in/out, optional persistence) over track, identify, and automatic capture.
  • Mobile auto-properties, app-lifecycle auto-tracking (app_open/app_close), and automatic campaign capture from app/deep links (requires app_links 6.x).
  • Auto page-views via PugRouteObserver: route changes emit screen_view (with a screenName property) on iOS/Android and page_view on web; every event also carries $url/$referrer auto-properties. Desktop emits no navigation event.
  • $timezone reports the IANA identifier (e.g. Asia/Kolkata), falling back to the platform abbreviation when unavailable; $deviceName is intentionally not sent (PII).
  • Provider-neutral push registration with notification received/clicked/dismissed helpers (all sent immediately; a missing, empty, or non-string campaignId defaults to (unknown)).
  • Pluggable storage (SharedPreferences default, in-memory opt-out), logger, clock, and ID generator.
1
likes
150
points
925
downloads

Documentation

Documentation
API reference

Publisher

verified publisherpug.sh

Weekly Downloads

Open-source product analytics SDK for Flutter: tracks app opens and installs, and screen views on Android and iOS, with identity, sessions and a consent gate.

Homepage
Repository (GitHub)
View/report issues

Topics

#analytics #product-analytics #tracking #events #telemetry

License

MIT (license)

Dependencies

connectivity_plus, device_info_plus, fixnum, flutter, flutter_timezone, http, meta, package_info_plus, protobuf, shared_preferences

More

Packages that depend on pug_flutter