Releases: mixpanel/mixpanel-js
Fixes and minor updates
get_api_host()
is now used consistently across the SDK to ensure that per-endpoint API host configs are respected everywhere- A fix is included for the ordering of (asynchronous) operations when calling
mixpanel.reset()
while a session recording is active - Default Feature Flag context now includes
device_id
alongsidedistinct_id
$experiment_started
events now include several API-latency-tracking properties
Fine-grained API host configuration and session recording fixes
A new api_hosts
configuration option enables different endpoints (events, profiles, groups, session recordings) to be sent to different hosts, for selective proxying, e.g.:
mixpanel.init('<TOKEN>', {
api_hosts: {
// proxy only session-recording requests, and leave the rest on the default host api-js.mixpanel.com
'record': 'https://my-proxy.com',
},
});
This release also fixes a race condition when calling mixpanel.reset()
while a session recording is active, and adds an initial TypeScript types.d.ts
file.
Updates to revenue, session recording, autocapture, etc
This release packages up changes and improvements to several subsystems:
- The long-deprecated
mixpanel.people.track_charge()
method now only prints a console error and no longer sets a profile property or produces any other change. The old version of Mixpanel's Revenue analysis UI has been replaced by a newer suite of analysis tools which don't depend on profile properties (see https://docs.mixpanel.com/docs/features/revenue_analytics). - Autocapture click tracking properties now include page height and width.
- Session recording now stops when
mixpanel.reset()
is called. - New init option
api_extra_query_params
adds support for appending arbitrary query string params to tracking requests (useful for non-standard proxy setups) - The API of the Feature Flagging system (under development) has been revised
- Whale Browser is now detected automatically
Dependency and build upgrades
This release upgrades session-recording library rrweb to the latest alpha version. In conjunction, the SDK's build process has been refactored and Closure Compiler updated.
Native UUID and JSON serialization
- UUIDs are now generated as UUIDv4. When available, the native randomUUID() from the Crypto API is used; otherwise the library falls back to a simple custom UUIDv4 implementation.
- When available, the library now consistently uses native
JSON.stringify()
for serializing request data, only falling back to the older custom JSON encoding implementation if the environment doesn't have native JSON APIs. - Fixes a Session Recording race condition where sometimes the idle timeout is reset past when it should have fired due to a backgrounded tab.
Revert event/user queue throttling
- Removes 10ms throttle of event / user data queueing that was added in 2.61.0. The additional 10ms regressed the reliability of firing tracking updates when a page is about to unload.
Session Recording Fixes & Reliability
- Stops recording when the initial full snapshot of the DOM fails to generate, preventing the ingestion of blank recordings
- Try/catch rrweb's
record
to prevent any user facing errors - Fix broken opt-out check that was spamming error messages when
debug
mode is on (introduced in 2.61.0)
Session recording continuation across page loads
This release focuses on continuing an active session recording across HTML page loads (different mixpanel.init() calls)
- Session recordings are now persisted and continue recording across HTML page loads in a single tab
- Session recording now uses IndexedDB when available to queue and persist data for reliability under poor network conditions etc.
v2.60.0
- Autocapture support. See: https://docs.mixpanel.com/docs/tracking-methods/autocapture
- prevent duplicate values in cookie storage when using union #354 by @chrisdeely in #459
New Contributors
- @chrisdeely made their first contribution in #459
Full Changelog: v2.59.0...v2.60.0
v2.59.0
- Block more crawlers (AmazonBot, more Yandex bots)
Full Changelog: v2.58.0...v2.59.0