Skip to content

Release/4.10.0 - #1495

Merged
Matus Tomlein (matus-tomlein) merged 4 commits into
masterfrom
release/4.10.0
Jul 27, 2026
Merged

Release/4.10.0#1495
Matus Tomlein (matus-tomlein) merged 4 commits into
masterfrom
release/4.10.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Note: the workflow flagged #1494 and #1490 as external contributions, but the author is snowplow-claude-review[bot] — a Snowplow-owned bot, not an external contributor — so I've omitted the "thanks to" attribution. Add it back if you want the bot credited.

New features

Bug fixes

snowplow-claude-review Bot and others added 4 commits July 24, 2026 17:04
…PA referrer tracking (close #1461) (#1491)

* loop: implement snowplow-javascript-tracker (loop/3a607af295a280da8c2adea3051ca267-snowplow-javascript-tracker)

* loop: implement snowplow-javascript-tracker (loop/3a607af295a280da8c2adea3051ca267-snowplow-javascript-tracker)

* loop: implement snowplow-javascript-tracker (loop/3a607af295a280da8c2adea3051ca267-snowplow-javascript-tracker)

---------

Co-authored-by: snowplow-loop[bot] <snowplow-loop[bot]@users.noreply.github.com>
…ture flag (close #1455) (#1493)

* loop: implement snowplow-javascript-tracker (loop/gh-snowplow-incubator-refine-agent-129-snowplow-javascript-tracker)

* loop: implement snowplow-javascript-tracker (loop/gh-snowplow-incubator-refine-agent-129-snowplow-javascript-tracker)

* loop: implement snowplow-javascript-tracker (loop/gh-snowplow-incubator-refine-agent-129-snowplow-javascript-tracker)

* loop: implement snowplow-javascript-tracker (loop/gh-snowplow-incubator-refine-agent-129-snowplow-javascript-tracker)

---------

Co-authored-by: snowplow-loop[bot] <snowplow-loop[bot]@users.noreply.github.com>
…tialization (#1490)

The tracker called `getBrowserProperties()` at construction time (`tracker/index.ts:330`), which reads layout geometry (`scrollWidth`, `scrollHeight`, `offsetWidth`) and triggers a forced reflow on every page that loads the tracker. Google PageSpeed Insights flags this as a performance issue.

This change removes that init-time call. The four properties that were actually needed at construction (`cookiesEnabled`, `colorDepth`, `browserLanguage`, `resolution`) are now read directly from non-layout APIs:

```ts
const cookiesEnabled = window.navigator.cookieEnabled;
const colorDepth = screen.colorDepth;
const browserLanguage = window.navigator.language || (window.navigator as any).userLanguage;
const resolution = makeDimension(screen.width, screen.height);
```

The first call to `readBrowserProperties()` — which does read layout — is deferred to first event build time: via `getBrowserContextPlugin.contexts()` when `contexts.browser: true`, or `getBrowserDataPlugin.beforeTrack()` in the default config. Both paths share the existing module-level `cachedProperties`, so layout is read exactly once per page lifecycle. The ResizeObserver+rAF path continues to handle all subsequent cache updates.

Co-authored-by: snowplow-loop[bot] <snowplow-loop[bot]@users.noreply.github.com>
…tion (#1494)

## What and why

In hybrid native+WebView deployments the JavaScript tracker and the
native mobile tracker both attach a `client_session` entity to every
event. This produces two `client_session` entities on WebView events,
which causes `dbt-snowplow-unified` to drop or misattribute sessions
because it expects exactly one per event.

The current workaround — wrapping `contexts.session` in a
`hasMobileInterface()` call — is undocumented, brittle (requires an
extra import), and easy to get wrong.

This PR introduces `disableSessionContextWithinWebView: boolean`
(default `false`) on `TrackerConfiguration`. When enabled and a V2
WebView interface is present at event-fire time, the tracker skips
attaching `client_session`.

## Implementation

**`browser-tracker-core/src/tracker/types.ts`** — added
`disableSessionContextWithinWebView?: boolean` with JSDoc.

**`browser-tracker-core/src/tracker/index.ts`** — reads the new config
(defaulting to `false`), adds a private `isInWebView()` helper that
checks the three stable V2 interface identifiers:

```
window.SnowplowWebInterfaceV2
window.webkit?.messageHandlers?.snowplowV2
window.ReactNativeWebView
```

This mirrors `hasMobileInterface()` in `@snowplow/webview-tracker`
without adding a dependency on that package — which would otherwise
bundle it for all tracker users regardless of whether they use WebView
tracking. The session-entity guard is extended to also skip when
`configDisableSessionInWebView && isInWebView()`.

**Tests** — three cases in `session_data.test.ts`: (a) option `true` +
WebView detected → no `client_session` in payload; (b) option explicitly
`false` + WebView detected → `client_session` present; (c) option absent
+ WebView detected → `client_session` present (backward compat). One
case added to `browser-plugin-webview/test/webview.test.ts` verifying
the forwarded `context` array excludes `client_session` when the option
is active.

**Rush change file** — minor bump for `@snowplow/browser-tracker-core`.

## Reviewer notes

- The `isInWebView()` check intentionally reads `window` directly (not
via a mock/DI seam) to stay consistent with how the existing
`contexts.session` guard already evaluates at runtime.
- Default is `false` (opt-in) so existing hybrid deployments are
unaffected without a major-version bump.
- No changes to the public plugin API; `browser-plugin-webview` and
`browser-tracker-core` are the only touched packages.

---
_Draft PR opened for review — please verify and run CI before merging._

---------

Co-authored-by: snowplow-loop[bot] <snowplow-loop[bot]@users.noreply.github.com>
@snowplowcla

Copy link
Copy Markdown

Thanks for your pull request. Is this your first contribution to a Snowplow open source project? Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://docs.snowplowanalytics.com/docs/contributing/contributor-license-agreement/ to learn more and sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.

@snowplowcla Snowplow CLA bot (snowplowcla) added the cla:no [Auto generated] Snowplow Contributor License Agreement has not been signed. label Jul 27, 2026
@matus-tomlein
Matus Tomlein (matus-tomlein) merged commit 9295cf2 into master Jul 27, 2026
7 checks passed
@matus-tomlein
Matus Tomlein (matus-tomlein) deleted the release/4.10.0 branch July 27, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:no [Auto generated] Snowplow Contributor License Agreement has not been signed.

Development

Successfully merging this pull request may close these issues.

2 participants