Skip to content

✨ [Shopify] Add a RUM SDK for Shopify Web Pixel app extensions - #5108

Draft
BeltranBulbarellaDD wants to merge 24 commits into
mainfrom
beltran.bulbarella/shopify-web-pixel
Draft

BeltranBulbarellaDD wants to merge 24 commits into
mainfrom
beltran.bulbarella/shopify-web-pixel

Conversation

@BeltranBulbarellaDD

@BeltranBulbarellaDD BeltranBulbarellaDD commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Shopify Web Pixel app extensions run in a sandboxed worker without DOM access. Collect checkout RUM events while continuing the session created by the storefront SDK.

Changes

  • Add a Web Pixel SDK bundle that owns Shopify's single registration and reads settings.rumConfig.
  • Capture browser.cookie internally and adapt its async get/set methods in the Shopify package. Supply the store directly to the shared session manager; public sessionPersistence keeps its existing browser options.
  • Start checkout collection after analytics consent and translate Shopify events into RUM views, actions, and errors. Reuse shared cookie serialization and session lifecycle logic.
  • Add unit tests, Web Pixel e2e coverage, bundle/deployment fixtures, and usage documentation.

Test instructions

  • Passed: yarn lint, yarn typecheck, yarn format, yarn build, and 195 targeted unit tests covering cookie access, configuration, session storage, registration, and checkout collection.
  • Rebuilt the local Shopify PoC. Existing lint and Shopify BigInt target warnings remain.
  • For a manual check, load the local bundles in the PoC, grant analytics consent, note the storefront _dd_s_v2 session ID, then enter checkout and verify the same ID. The previous live PoC check confirmed matching IDs; the latest adapter relocation has unit coverage but has not been retested live.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum Salesforce N/A 185.81 KiB N/A N/A N/A
Rum 185.65 KiB 185.79 KiB +144 B +0.08% ✅
Rum-salesforce Profiler N/A 8.38 KiB N/A N/A N/A
Rum Profiler 8.38 KiB 8.38 KiB 0 B 0.00% ✅
Rum-salesforce Recorder N/A 31.94 KiB N/A N/A N/A
Rum Recorder 31.94 KiB 31.94 KiB 0 B 0.00% ✅
Logs 59.57 KiB 59.71 KiB +144 B +0.24% ✅
Rum Slim 143.65 KiB 143.79 KiB +144 B +0.10% ✅
Worker 22.96 KiB 22.96 KiB 0 B 0.00% ✅
Rum Shopify-web-pixel N/A 30.92 KiB N/A N/A N/A
Rum Shopify N/A 216.20 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.38 KiB N/A N/A N/A
Rum-shopify Recorder N/A 4.77 KiB N/A N/A N/A

@datadog-official

datadog-official Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/browser-sdk | unit-bs: [chrome-mobile]

View more details · View in GitLab

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 82.76%
• Overall Coverage: 77.23% (+0.03%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a1e669c | Docs | View more details | Give us feedback!

BeltranBulbarellaDD and others added 5 commits October 5, 2026 11:42
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BeltranBulbarellaDD
BeltranBulbarellaDD force-pushed the beltran.bulbarella/shopify-web-pixel branch from 4db1ff5 to be29705 Compare October 5, 2026 09:44
BeltranBulbarellaDD and others added 3 commits October 5, 2026 12:15
- Type raw events with DefaultRumEventAttributes, derived from the generated RUM event schema,
  instead of a hand-written RawEvent union
- Type the view loading type with ViewLoadingType, exported as a type from browser-rum-core
- Use error source and handling literals instead of importing ErrorSource and ErrorHandling
- Only send the anonymous id when trackAnonymousUser is enabled, like the RUM SDK user context

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move the Shopify API types, configuration schema, consent mapping, checkout context and RUM event
builders out of startWebPixelRum, so it only keeps the collection flow.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add an internal `sessionCookieAccess` init option and a `CookieApi.CUSTOM`
cookie API, so integrations running where neither `document.cookie` nor the
Cookie Store API is available (e.g. a Shopify Web Pixel worker) can persist the
session in the top frame cookies.

When provided, `selectCookieStrategy` only probes this access, and the legacy
`_dd_s` cookie migration (read through `document.cookie`) is skipped.
`buildCookieString` is extracted from `setCookie` so such accesses can format
cookies the same way.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
BeltranBulbarellaDD and others added 2 commits October 5, 2026 14:29
- Default workers to cookie persistence when a custom cookie access is
  provided, instead of memory.
- Treat a throwing cookie access factory as unauthorized cookies in
  `areCookiesAuthorized`, so the next persistence fallback is tried.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Run the storefront to thank you page flow on the Web Pixel POC dev store, and check that the
storefront SDK and the Web Pixel SDK share one session. The local bundles replace the CDN ones, and
intake requests, sent to the intake configured in the app, are forwarded to the test intake.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@BeltranBulbarellaDD BeltranBulbarellaDD changed the title Beltran.bulbarella/shopify web pixel ✨ [Shopify] Add a RUM SDK for Shopify Web Pixel app extensions Oct 5, 2026
BeltranBulbarellaDD and others added 14 commits October 5, 2026 16:21
The strategy only serves the Shopify Web Pixel integration for now, so name
it after it: `sessionInShopifyCookie.ts`, `ShopifySessionStoreStrategyType`
(`type: 'shopify'`), `selectShopifyCookieStrategy` and
`initShopifyCookieStrategy`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…opify-web-pixel

# Conflicts:
#	packages/browser-core/src/domain/session/sessionManager.spec.ts
#	packages/browser-core/src/domain/session/sessionManager.ts
…n-store' into beltran.bulbarella/shopify-web-pixel

# Conflicts:
#	packages/browser-core/src/domain/configuration/configuration.ts
#	packages/browser-core/src/domain/session/storeStrategies/sessionInCookie.ts
…n-store' into beltran.bulbarella/shopify-web-pixel
@BeltranBulbarellaDD
BeltranBulbarellaDD force-pushed the beltran.bulbarella/shopify-web-pixel branch from f99fa27 to a1e669c Compare October 13, 2026 09:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant