Skip to content

Conversation

@Amitpe
Copy link

@Amitpe Amitpe commented Oct 27, 2025

This POC demonstrates the requirements for adding analytics tracking to the Add to Cart functionality:

Changes:

  • Added @wix/site dependency to stores package for analytics.trackEvent
  • Integrated analytics.trackEvent call in SelectedVariantService.addToCart
  • Added placeholder comments indicating where product/variant details need to be accessed
  • Modified ProductActionAddToCart onClick handler to support analytics integration
  • Added debug console.logs to track execution flow

Key Questions to Resolve:

  1. Where should analytics.trackEvent be called - in the service or component?
  2. How to efficiently pass product/variant details to trackEvent without duplicating logic from createLineItems?
  3. What parameters are required by the AddToCart analytics event?

Technical Notes:

  • analytics.trackEvent requires product and variant details as parameters
  • Current implementation has access to v3Product and currentVariant via signals
  • Need to coordinate with createLineItems to avoid code duplication

This POC demonstrates the requirements for adding analytics tracking to the Add to Cart functionality:

Changes:
- Added @wix/site dependency to stores package for analytics.trackEvent
- Integrated analytics.trackEvent call in SelectedVariantService.addToCart
- Added placeholder comments indicating where product/variant details need to be accessed
- Modified ProductActionAddToCart onClick handler to support analytics integration
- Added debug console.logs to track execution flow

Key Questions to Resolve:
1. Where should analytics.trackEvent be called - in the service or component?
2. How to efficiently pass product/variant details to trackEvent without duplicating logic from createLineItems?
3. What parameters are required by the AddToCart analytics event?

Technical Notes:
- analytics.trackEvent requires product and variant details as parameters
- Current implementation has access to v3Product and currentVariant via signals
- Need to coordinate with createLineItems to avoid code duplication
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