Skip to content

feat: add cart infering, update tracking documentation #1311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

dkonieczek
Copy link
Contributor

No description provided.

@dkonieczek dkonieczek requested review from korgon and Copilot May 14, 2025 14:40
@dkonieczek dkonieczek linked an issue May 14, 2025 that may be closed by this pull request
Copy link

@Copilot 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.

Pull Request Overview

This PR introduces cart inference functionality in the tracker along with comprehensive updates to tracking documentation across multiple packages.

  • Adds a new optional cart property to the tracker globals and processes cart updates in the tracker logic.
  • Extends tests to validate cart inference behavior.
  • Updates documentation for tracking events and context to align with the new cart and event structures.

Reviewed Changes

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

Show a summary per file
File Description
packages/snap-tracker/src/types.ts Adds an optional cart array to the tracker globals and imports the Product type.
packages/snap-tracker/src/Tracker.ts Implements cart inference: comparing current vs. stored cart to trigger add/remove events and sends error notifications for invalid cart objects.
packages/snap-tracker/src/Tracker.test.ts Introduces tests covering various cart scenarios including empty carts, addition, removal, and error handling.
packages/snap-preact/src/Snap.tsx Merges cart data from shopper context into tracker globals and removes legacy cookie population.
packages/snap-preact/src/Snap.test.tsx Adjusts tests to validate tracker storage cart updates reflecting the new cart inference feature.
docs/* and packages/snap-controller/* Updates tracking documentation and event naming across multiple controllers and integration guides.

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.

Beacon 2.0 Cart Tracking
2 participants