Skip to content

Conversation

@silesky
Copy link
Contributor

@silesky silesky commented Feb 27, 2025

Add data.page property to all signals.

image

@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2025

🦋 Changeset detected

Latest commit: 2306bc2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@segment/analytics-signals Minor
@segment/analytics-signals-runtime Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.82%. Comparing base (3d10bd9) to head (2306bc2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1238      +/-   ##
==========================================
+ Coverage   83.78%   83.82%   +0.04%     
==========================================
  Files         220      221       +1     
  Lines        5857     5861       +4     
  Branches     1337     1337              
==========================================
+ Hits         4907     4913       +6     
+ Misses        950      948       -2     
Flag Coverage Δ
browser 92.22% <ø> (ø)
core 89.86% <ø> (ø)
node 87.93% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@silesky silesky requested a review from Copilot February 27, 2025 17:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR adds page data tracking to web signals by introducing a dedicated PageData interface and updating signal factories, tests, and related functionality to include page details in signal payloads.

  • Introduces the PageData interface and getPageData helper.
  • Updates factories to include page data in all signal types.
  • Adjusts tests and redaction logic to account for the new page data field.

Reviewed Changes

File Description
packages/signals/signals-integration-tests/src/helpers/fixtures.ts Adds a PageData fixture for testing.
packages/signals/signals/src/lib/page-data/index.ts Implements getPageData to extract page information.
.changeset/pink-ladybugs-impress.md Updates the changeset metadata for the release.
packages/signals/signals/src/types/tests/create-network-signal.test.ts Updates tests for network signals to include page data.
packages/signals/signals/src/core/signal-generators/network-gen/tests/network-generator.test.ts Updates tests to include page data in network signals.
packages/signals/signals/src/core/middleware/signals-ingest/tests/client.test.ts Updates instrumentation and network signal tests to use signal factories and expect page data.
packages/signals/signals-runtime/src/web/web-signals-types.ts Introduces and documents the PageData interface for web signals.
packages/signals/signals-runtime/src/test-helpers/mocks/mock-signal-types-web.ts Updates mocks to include page data.
packages/signals/signals/src/core/analytics-service/tests/analytics-service.test.ts Modifies tests to account for the new page data field.
packages/signals/signals/src/types/factories.ts Updates all signal factory functions to include page data when creating signals.
packages/signals/signals/src/core/middleware/signals-ingest/redact.ts Adjusts redaction logic to only redact sensitive data while preserving page data.
packages/signals/signals-integration-tests/src/tests/signals-vanilla/basic.test.ts Updates tests to validate that page data is present in instrumentation and interaction signals.
packages/signals/signals-integration-tests/src/tests/signals-vanilla/network-signals-fetch.test.ts Updates fetch tests to include page data using the commonSignalData fixture.
packages/signals/signals/src/core/middleware/signals-ingest/tests/redact.test.ts Adjusts tests to use the updated signal factories.
packages/signals/signals-runtime/src/tests/signals-runtime.test.ts Updates runtime tests to include and check page data.

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Copy link
Contributor

@alanjcharles alanjcharles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dope!

@silesky silesky merged commit 0596bc4 into master Feb 28, 2025
8 checks passed
@silesky silesky deleted the add-page-context-to-signals branch February 28, 2025 16:37
@github-actions github-actions bot mentioned this pull request Feb 28, 2025
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.

3 participants