·
5 commits
to newjitsu
since this release
Jitsu Client Libraries 1.11.0
Changes that affect users of @jitsu/js (and @jitsu/react) since 1.10.4. Build/tooling, packaging and internal refactors are omitted.
New features
- GTM destination — self-managed loading. New
loadGtmoption lets you load Google Tag Manager yourself; Jitsu then only pushes to the data layer instead of injecting the GTM script. NewresetDataLayeroption (defaulttrue) controls whether Jitsu clears the data it pushed between events, clearing only Jitsu-set keys rather than resetting the whole data layer. preInitAnonymousIdoption. Creates the anonymous-id cookie synchronously at init, so the id is available for first-page server-side reads instead of being set lazily on the first event.- Auto-identify on init. If
userIdis passed in the options, the client now writes it to storage and automatically sends anidentifyon startup, so the user is identified before your first explicit call. - New
user()method. Returns the current user — privacy-aware (returns no id when user ids are disabled) and falls back to the configureduserIduntilreset()is called.
Fixes
- Array values in traits / properties / context are now replaced wholesale on merge instead of being merged element-by-element (prevents stale array items leaking between merges).
- Server-side / no-URL events no longer throw when there is no page URL (Node / SSR usage).
- Script-tag
data-*attribute parsing is now null-safe — a missing attribute no longer crashes initialization. - Auto-identify failures are logged as warnings instead of being routed to your configured error handler, so they can't trip your error policy.
- Correct anonymous-id cookie scoping on
vercel.appandwebflow.io(added to the public-suffix list). - ga4: skip the
page_viewevent when page properties are missing (avoids emitting malformed events). - logrocket: guard against a missing method when flushing queued calls.
Behavior changes — please review when upgrading from 1.10.4
- Passing
userIdin the constructor options now triggers an automaticidentifyon init and populatesuser().idbefore any explicitidentify()call. If you relied on no event being sent until your first call, this is a new network side-effect. - Array values in event payloads now fully replace rather than element-wise merge — payloads that combine arrays may serialize differently than in 1.10.4.
Full diff: jitsu-js-libs-v1.10.4...jsclient1.11.0