@chordcommerce/analytics 1.22.0-beta.3 → 1.22.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,6 @@ import { addCdpSnippet, cdpQueue } from './cdp.js';
11
11
  import { addCdpConsent } from './consent/index.js';
12
12
  import { eventSchemas } from '../validators/index.js';
13
13
  import { pruneNullValues } from '../utils.js';
14
- import { syncIdentifiersToCart as syncIdentifiers, } from './identifiers.js';
15
14
  const DEBUG_MODE_STORAGE_KEY = 'chordcommerce/analytics/debug';
16
15
  const CONSENT_QUEUE_STORAGE_KEY = 'chordcommerce/analytics/consent-queue';
17
16
  const CONSENT_QUEUE_TTL_MS = 5 * 60 * 1000; // 5 minutes
@@ -19,7 +18,7 @@ const CONSENT_QUEUE_MAX_SIZE_BYTES = 100 * 1024; // 100KB max queue size
19
18
  const CONSENT_QUEUE_MAX_EVENTS = 50; // Max number of events to queue
20
19
  export class ChordAnalytics {
21
20
  constructor(options) {
22
- var _a, _b, _c, _d, _e, _f, _g;
21
+ var _a, _b, _c, _d;
23
22
  /**
24
23
  * Allows snippet.js to detect whether this library has been initialized yet.
25
24
  */
@@ -586,7 +585,7 @@ export class ChordAnalytics {
586
585
  });
587
586
  });
588
587
  this.reset = () => __awaiter(this, void 0, void 0, function* () {
589
- var _h;
588
+ var _e;
590
589
  try {
591
590
  this.resetInProgress = true;
592
591
  const a = this.ccdp();
@@ -603,12 +602,12 @@ export class ChordAnalytics {
603
602
  // eslint-disable-next-line
604
603
  yield new Promise((resolve) => setTimeout(resolve, 10));
605
604
  try {
606
- const userState = ((_h = a === null || a === void 0 ? void 0 : a.user) === null || _h === void 0 ? void 0 : _h.call(a)) || {};
605
+ const userState = ((_e = a === null || a === void 0 ? void 0 : a.user) === null || _e === void 0 ? void 0 : _e.call(a)) || {};
607
606
  if (userState.userId === null || userState.userId === undefined) {
608
607
  break;
609
608
  }
610
609
  }
611
- catch (_j) {
610
+ catch (_f) {
612
611
  break;
613
612
  }
614
613
  attempts++;
@@ -654,6 +653,18 @@ export class ChordAnalytics {
654
653
  return;
655
654
  if (event.data.source !== 'chord-web-pixel')
656
655
  return;
656
+ // Validate origin — only accept messages from the same hostname or from
657
+ // null-origin sandboxed iframes (Shopify web pixel sandbox has origin "null")
658
+ try {
659
+ if (event.origin && event.origin !== 'null') {
660
+ const eventHostname = new URL(event.origin).hostname;
661
+ if (eventHostname !== window.location.hostname)
662
+ return;
663
+ }
664
+ }
665
+ catch (_a) {
666
+ return;
667
+ }
657
668
  const message = event.data;
658
669
  if (this.options.enableLogging && this.options.debug) {
659
670
  // eslint-disable-next-line no-console
@@ -664,18 +675,18 @@ export class ChordAnalytics {
664
675
  case 'track': {
665
676
  const [eventName, properties] = message.payload;
666
677
  if (eventName) {
667
- this.track(eventName, properties);
678
+ Promise.resolve(this.track(eventName, properties)).catch((err) => this.logger('[Chord Analytics]: Error in web pixel track:', err));
668
679
  }
669
680
  break;
670
681
  }
671
682
  case 'identify': {
672
683
  const [userId, traits] = message.payload;
673
- this.identify(userId, traits);
684
+ Promise.resolve(this.identify(userId, traits)).catch((err) => this.logger('[Chord Analytics]: Error in web pixel identify:', err));
674
685
  break;
675
686
  }
676
687
  case 'page': {
677
688
  const [properties] = message.payload;
678
- this.page(properties);
689
+ Promise.resolve(this.page(undefined, properties)).catch((err) => this.logger('[Chord Analytics]: Error in web pixel page:', err));
679
690
  break;
680
691
  }
681
692
  default:
@@ -697,28 +708,10 @@ export class ChordAnalytics {
697
708
  }
698
709
  };
699
710
  };
700
- /**
701
- * Sync CDP anonymous ID and Google Client ID to Shopify cart attributes.
702
- * This enables server-side events (webhooks) to correlate with client-side tracking.
703
- *
704
- * By default, syncs:
705
- * - `_cdpAnonymousId`: from the `__eventn_id` cookie (Chord/Jitsu CDP)
706
- * - `_googleClientId`: from the `_ga` cookie (Google Analytics)
707
- *
708
- * @param options - Optional configuration for the sync
709
- * @returns The updated cart, or undefined if no update was needed or an error occurred
710
- */
711
- this.syncIdentifiersToCart = (options) => __awaiter(this, void 0, void 0, function* () {
712
- const result = yield syncIdentifiers(options);
713
- if (result) {
714
- this.logger('[Chord Analytics]: Identifiers synced to cart');
715
- }
716
- return result;
717
- });
718
711
  // TODO: Add support for props.products
719
712
  this.trackCartViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
720
- var _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
721
- const cart = (_o = (_m = (_l = (_k = this.options) === null || _k === void 0 ? void 0 : _k.formatters) === null || _l === void 0 ? void 0 : _l.objects) === null || _m === void 0 ? void 0 : _m.cart) === null || _o === void 0 ? void 0 : _o.call(_m, {
713
+ var _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
714
+ const cart = (_k = (_j = (_h = (_g = this.options) === null || _g === void 0 ? void 0 : _g.formatters) === null || _h === void 0 ? void 0 : _h.objects) === null || _j === void 0 ? void 0 : _j.cart) === null || _k === void 0 ? void 0 : _k.call(_j, {
722
715
  cart: props === null || props === void 0 ? void 0 : props.cart,
723
716
  });
724
717
  const payload = {
@@ -727,17 +720,17 @@ export class ChordAnalytics {
727
720
  products: cart === null || cart === void 0 ? void 0 : cart.products,
728
721
  value: cart === null || cart === void 0 ? void 0 : cart.value,
729
722
  };
730
- if ((_r = (_q = (_p = this.options) === null || _p === void 0 ? void 0 : _p.formatters) === null || _q === void 0 ? void 0 : _q.events) === null || _r === void 0 ? void 0 : _r.cartViewed) {
731
- const formattedPayload = (_u = (_t = (_s = this.options) === null || _s === void 0 ? void 0 : _s.formatters) === null || _t === void 0 ? void 0 : _t.events) === null || _u === void 0 ? void 0 : _u.cartViewed(props, payload);
723
+ if ((_o = (_m = (_l = this.options) === null || _l === void 0 ? void 0 : _l.formatters) === null || _m === void 0 ? void 0 : _m.events) === null || _o === void 0 ? void 0 : _o.cartViewed) {
724
+ const formattedPayload = (_r = (_q = (_p = this.options) === null || _p === void 0 ? void 0 : _p.formatters) === null || _q === void 0 ? void 0 : _q.events) === null || _r === void 0 ? void 0 : _r.cartViewed(props, payload);
732
725
  return this.track('Cart Viewed', formattedPayload, options);
733
726
  }
734
727
  return this.track('Cart Viewed', payload, options);
735
728
  });
736
729
  // TODO: Add support for props.products
737
730
  this.trackCheckoutStarted = (props, options) => __awaiter(this, void 0, void 0, function* () {
738
- var _v, _w, _x, _y, _z, _0, _1;
739
- const formatter = (_x = (_w = (_v = this.options) === null || _v === void 0 ? void 0 : _v.formatters) === null || _w === void 0 ? void 0 : _w.events) === null || _x === void 0 ? void 0 : _x.checkoutStarted;
740
- const checkout = (_1 = (_0 = (_z = (_y = this.options) === null || _y === void 0 ? void 0 : _y.formatters) === null || _z === void 0 ? void 0 : _z.objects) === null || _0 === void 0 ? void 0 : _0.checkout) === null || _1 === void 0 ? void 0 : _1.call(_0, {
731
+ var _s, _t, _u, _v, _w, _x, _y;
732
+ const formatter = (_u = (_t = (_s = this.options) === null || _s === void 0 ? void 0 : _s.formatters) === null || _t === void 0 ? void 0 : _t.events) === null || _u === void 0 ? void 0 : _u.checkoutStarted;
733
+ const checkout = (_y = (_x = (_w = (_v = this.options) === null || _v === void 0 ? void 0 : _v.formatters) === null || _w === void 0 ? void 0 : _w.objects) === null || _x === void 0 ? void 0 : _x.checkout) === null || _y === void 0 ? void 0 : _y.call(_x, {
741
734
  checkout: props === null || props === void 0 ? void 0 : props.checkout,
742
735
  });
743
736
  const payload = checkout;
@@ -748,8 +741,8 @@ export class ChordAnalytics {
748
741
  return this.track('Checkout Started', payload, options);
749
742
  });
750
743
  this.trackCheckoutStepCompleted = (props, options) => __awaiter(this, void 0, void 0, function* () {
751
- var _2, _3, _4;
752
- const formatter = (_4 = (_3 = (_2 = this.options) === null || _2 === void 0 ? void 0 : _2.formatters) === null || _3 === void 0 ? void 0 : _3.events) === null || _4 === void 0 ? void 0 : _4.checkoutStepCompleted;
744
+ var _z, _0, _1;
745
+ const formatter = (_1 = (_0 = (_z = this.options) === null || _z === void 0 ? void 0 : _z.formatters) === null || _0 === void 0 ? void 0 : _0.events) === null || _1 === void 0 ? void 0 : _1.checkoutStepCompleted;
753
746
  const payload = {
754
747
  checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
755
748
  payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
@@ -763,8 +756,8 @@ export class ChordAnalytics {
763
756
  return this.track('Checkout Step Completed', payload, options);
764
757
  });
765
758
  this.trackCheckoutStepViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
766
- var _5, _6, _7;
767
- const formatter = (_7 = (_6 = (_5 = this.options) === null || _5 === void 0 ? void 0 : _5.formatters) === null || _6 === void 0 ? void 0 : _6.events) === null || _7 === void 0 ? void 0 : _7.checkoutStepViewed;
759
+ var _2, _3, _4;
760
+ const formatter = (_4 = (_3 = (_2 = this.options) === null || _2 === void 0 ? void 0 : _2.formatters) === null || _3 === void 0 ? void 0 : _3.events) === null || _4 === void 0 ? void 0 : _4.checkoutStepViewed;
768
761
  const payload = {
769
762
  checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
770
763
  payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
@@ -778,8 +771,8 @@ export class ChordAnalytics {
778
771
  return this.track('Checkout Step Viewed', payload, options);
779
772
  });
780
773
  this.trackCouponApplied = (props, options) => __awaiter(this, void 0, void 0, function* () {
781
- var _8, _9, _10;
782
- const formatter = (_10 = (_9 = (_8 = this.options) === null || _8 === void 0 ? void 0 : _8.formatters) === null || _9 === void 0 ? void 0 : _9.events) === null || _10 === void 0 ? void 0 : _10.couponApplied;
774
+ var _5, _6, _7;
775
+ const formatter = (_7 = (_6 = (_5 = this.options) === null || _5 === void 0 ? void 0 : _5.formatters) === null || _6 === void 0 ? void 0 : _6.events) === null || _7 === void 0 ? void 0 : _7.couponApplied;
783
776
  const payload = {
784
777
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
785
778
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -794,8 +787,8 @@ export class ChordAnalytics {
794
787
  return this.track('Coupon Applied', payload, options);
795
788
  });
796
789
  this.trackCouponDenied = (props, options) => __awaiter(this, void 0, void 0, function* () {
797
- var _11, _12, _13;
798
- const formatter = (_13 = (_12 = (_11 = this.options) === null || _11 === void 0 ? void 0 : _11.formatters) === null || _12 === void 0 ? void 0 : _12.events) === null || _13 === void 0 ? void 0 : _13.couponDenied;
790
+ var _8, _9, _10;
791
+ const formatter = (_10 = (_9 = (_8 = this.options) === null || _8 === void 0 ? void 0 : _8.formatters) === null || _9 === void 0 ? void 0 : _9.events) === null || _10 === void 0 ? void 0 : _10.couponDenied;
799
792
  const payload = {
800
793
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
801
794
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -810,8 +803,8 @@ export class ChordAnalytics {
810
803
  return this.track('Coupon Denied', payload, options);
811
804
  });
812
805
  this.trackCouponEntered = (props, options) => __awaiter(this, void 0, void 0, function* () {
813
- var _14, _15, _16;
814
- const formatter = (_16 = (_15 = (_14 = this.options) === null || _14 === void 0 ? void 0 : _14.formatters) === null || _15 === void 0 ? void 0 : _15.events) === null || _16 === void 0 ? void 0 : _16.couponEntered;
806
+ var _11, _12, _13;
807
+ const formatter = (_13 = (_12 = (_11 = this.options) === null || _11 === void 0 ? void 0 : _11.formatters) === null || _12 === void 0 ? void 0 : _12.events) === null || _13 === void 0 ? void 0 : _13.couponEntered;
815
808
  const payload = {
816
809
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
817
810
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -825,8 +818,8 @@ export class ChordAnalytics {
825
818
  return this.track('Coupon Entered', payload, options);
826
819
  });
827
820
  this.trackCouponRemoved = (props, options) => __awaiter(this, void 0, void 0, function* () {
828
- var _17, _18, _19;
829
- const formatter = (_19 = (_18 = (_17 = this.options) === null || _17 === void 0 ? void 0 : _17.formatters) === null || _18 === void 0 ? void 0 : _18.events) === null || _19 === void 0 ? void 0 : _19.couponRemoved;
821
+ var _14, _15, _16;
822
+ const formatter = (_16 = (_15 = (_14 = this.options) === null || _14 === void 0 ? void 0 : _14.formatters) === null || _15 === void 0 ? void 0 : _15.events) === null || _16 === void 0 ? void 0 : _16.couponRemoved;
830
823
  const payload = {
831
824
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
832
825
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -841,8 +834,8 @@ export class ChordAnalytics {
841
834
  return this.track('Coupon Removed', payload, options);
842
835
  });
843
836
  this.trackEmailCaptured = (props, options) => __awaiter(this, void 0, void 0, function* () {
844
- var _20, _21, _22;
845
- const formatter = (_22 = (_21 = (_20 = this.options) === null || _20 === void 0 ? void 0 : _20.formatters) === null || _21 === void 0 ? void 0 : _21.events) === null || _22 === void 0 ? void 0 : _22.emailCaptured;
837
+ var _17, _18, _19;
838
+ const formatter = (_19 = (_18 = (_17 = this.options) === null || _17 === void 0 ? void 0 : _17.formatters) === null || _18 === void 0 ? void 0 : _18.events) === null || _19 === void 0 ? void 0 : _19.emailCaptured;
846
839
  const payload = {
847
840
  email: props === null || props === void 0 ? void 0 : props.email,
848
841
  placement_component: props === null || props === void 0 ? void 0 : props.placementComponent,
@@ -855,13 +848,13 @@ export class ChordAnalytics {
855
848
  return this.track('Email Captured', payload, options);
856
849
  });
857
850
  this.trackProductAdded = (props, options) => __awaiter(this, void 0, void 0, function* () {
858
- var _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34;
859
- const formatter = (_25 = (_24 = (_23 = this.options) === null || _23 === void 0 ? void 0 : _23.formatters) === null || _24 === void 0 ? void 0 : _24.events) === null || _25 === void 0 ? void 0 : _25.productAdded;
860
- const product = (_29 = (_28 = (_27 = (_26 = this.options) === null || _26 === void 0 ? void 0 : _26.formatters) === null || _27 === void 0 ? void 0 : _27.objects) === null || _28 === void 0 ? void 0 : _28.product) === null || _29 === void 0 ? void 0 : _29.call(_28, props === null || props === void 0 ? void 0 : props.product);
861
- const cart = (_33 = (_32 = (_31 = (_30 = this.options) === null || _30 === void 0 ? void 0 : _30.formatters) === null || _31 === void 0 ? void 0 : _31.objects) === null || _32 === void 0 ? void 0 : _32.cart) === null || _33 === void 0 ? void 0 : _33.call(_32, {
851
+ var _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
852
+ const formatter = (_22 = (_21 = (_20 = this.options) === null || _20 === void 0 ? void 0 : _20.formatters) === null || _21 === void 0 ? void 0 : _21.events) === null || _22 === void 0 ? void 0 : _22.productAdded;
853
+ const product = (_26 = (_25 = (_24 = (_23 = this.options) === null || _23 === void 0 ? void 0 : _23.formatters) === null || _24 === void 0 ? void 0 : _24.objects) === null || _25 === void 0 ? void 0 : _25.product) === null || _26 === void 0 ? void 0 : _26.call(_25, props === null || props === void 0 ? void 0 : props.product);
854
+ const cart = (_30 = (_29 = (_28 = (_27 = this.options) === null || _27 === void 0 ? void 0 : _27.formatters) === null || _28 === void 0 ? void 0 : _28.objects) === null || _29 === void 0 ? void 0 : _29.cart) === null || _30 === void 0 ? void 0 : _30.call(_29, {
862
855
  cart: props === null || props === void 0 ? void 0 : props.cart,
863
856
  });
864
- const quantity = ((_34 = props === null || props === void 0 ? void 0 : props.product) === null || _34 === void 0 ? void 0 : _34.quantity) || 1;
857
+ const quantity = ((_31 = props === null || props === void 0 ? void 0 : props.product) === null || _31 === void 0 ? void 0 : _31.quantity) || 1;
865
858
  const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], total: product.price * (quantity || 1), value: product.price * (quantity || 1) });
866
859
  if (typeof formatter === 'function') {
867
860
  const formattedPayload = formatter(props, payload);
@@ -870,14 +863,14 @@ export class ChordAnalytics {
870
863
  return this.track('Product Added', payload, options);
871
864
  });
872
865
  this.trackProductClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
873
- var _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47;
874
- const formatter = (_37 = (_36 = (_35 = this.options) === null || _35 === void 0 ? void 0 : _35.formatters) === null || _36 === void 0 ? void 0 : _36.events) === null || _37 === void 0 ? void 0 : _37.productClicked;
875
- const product = (_41 = (_40 = (_39 = (_38 = this.options) === null || _38 === void 0 ? void 0 : _38.formatters) === null || _39 === void 0 ? void 0 : _39.objects) === null || _40 === void 0 ? void 0 : _40.product) === null || _41 === void 0 ? void 0 : _41.call(_40, props === null || props === void 0 ? void 0 : props.product);
876
- const cart = (_45 = (_44 = (_43 = (_42 = this.options) === null || _42 === void 0 ? void 0 : _42.formatters) === null || _43 === void 0 ? void 0 : _43.objects) === null || _44 === void 0 ? void 0 : _44.cart) === null || _45 === void 0 ? void 0 : _45.call(_44, {
866
+ var _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44;
867
+ const formatter = (_34 = (_33 = (_32 = this.options) === null || _32 === void 0 ? void 0 : _32.formatters) === null || _33 === void 0 ? void 0 : _33.events) === null || _34 === void 0 ? void 0 : _34.productClicked;
868
+ const product = (_38 = (_37 = (_36 = (_35 = this.options) === null || _35 === void 0 ? void 0 : _35.formatters) === null || _36 === void 0 ? void 0 : _36.objects) === null || _37 === void 0 ? void 0 : _37.product) === null || _38 === void 0 ? void 0 : _38.call(_37, props === null || props === void 0 ? void 0 : props.product);
869
+ const cart = (_42 = (_41 = (_40 = (_39 = this.options) === null || _39 === void 0 ? void 0 : _39.formatters) === null || _40 === void 0 ? void 0 : _40.objects) === null || _41 === void 0 ? void 0 : _41.cart) === null || _42 === void 0 ? void 0 : _42.call(_41, {
877
870
  cart: props === null || props === void 0 ? void 0 : props.cart,
878
871
  });
879
- const quantity = ((_46 = props === null || props === void 0 ? void 0 : props.product) === null || _46 === void 0 ? void 0 : _46.quantity) || 1;
880
- const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, item_list_id: (_47 = props === null || props === void 0 ? void 0 : props.listId) === null || _47 === void 0 ? void 0 : _47.toString(), item_list_name: props === null || props === void 0 ? void 0 : props.listName, products: [Object.assign(Object.assign({}, product), { quantity })] });
872
+ const quantity = ((_43 = props === null || props === void 0 ? void 0 : props.product) === null || _43 === void 0 ? void 0 : _43.quantity) || 1;
873
+ const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, item_list_id: (_44 = props === null || props === void 0 ? void 0 : props.listId) === null || _44 === void 0 ? void 0 : _44.toString(), item_list_name: props === null || props === void 0 ? void 0 : props.listName, products: [Object.assign(Object.assign({}, product), { quantity })] });
881
874
  if (typeof formatter === 'function') {
882
875
  const formattedPayload = formatter(props, payload);
883
876
  return this.track('Product Clicked', formattedPayload, options);
@@ -885,13 +878,13 @@ export class ChordAnalytics {
885
878
  return this.track('Product Clicked', payload, options);
886
879
  });
887
880
  this.trackVariantClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
888
- var _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59;
889
- const formatter = (_50 = (_49 = (_48 = this.options) === null || _48 === void 0 ? void 0 : _48.formatters) === null || _49 === void 0 ? void 0 : _49.events) === null || _50 === void 0 ? void 0 : _50.variantClicked;
890
- const product = (_54 = (_53 = (_52 = (_51 = this.options) === null || _51 === void 0 ? void 0 : _51.formatters) === null || _52 === void 0 ? void 0 : _52.objects) === null || _53 === void 0 ? void 0 : _53.product) === null || _54 === void 0 ? void 0 : _54.call(_53, props === null || props === void 0 ? void 0 : props.product);
891
- const cart = (_58 = (_57 = (_56 = (_55 = this.options) === null || _55 === void 0 ? void 0 : _55.formatters) === null || _56 === void 0 ? void 0 : _56.objects) === null || _57 === void 0 ? void 0 : _57.cart) === null || _58 === void 0 ? void 0 : _58.call(_57, {
881
+ var _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56;
882
+ const formatter = (_47 = (_46 = (_45 = this.options) === null || _45 === void 0 ? void 0 : _45.formatters) === null || _46 === void 0 ? void 0 : _46.events) === null || _47 === void 0 ? void 0 : _47.variantClicked;
883
+ const product = (_51 = (_50 = (_49 = (_48 = this.options) === null || _48 === void 0 ? void 0 : _48.formatters) === null || _49 === void 0 ? void 0 : _49.objects) === null || _50 === void 0 ? void 0 : _50.product) === null || _51 === void 0 ? void 0 : _51.call(_50, props === null || props === void 0 ? void 0 : props.product);
884
+ const cart = (_55 = (_54 = (_53 = (_52 = this.options) === null || _52 === void 0 ? void 0 : _52.formatters) === null || _53 === void 0 ? void 0 : _53.objects) === null || _54 === void 0 ? void 0 : _54.cart) === null || _55 === void 0 ? void 0 : _55.call(_54, {
892
885
  cart: props === null || props === void 0 ? void 0 : props.cart,
893
886
  });
894
- const quantity = ((_59 = props === null || props === void 0 ? void 0 : props.product) === null || _59 === void 0 ? void 0 : _59.quantity) || 1;
887
+ const quantity = ((_56 = props === null || props === void 0 ? void 0 : props.product) === null || _56 === void 0 ? void 0 : _56.quantity) || 1;
895
888
  const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, quantity: quantity, line_item_id: props === null || props === void 0 ? void 0 : props.lineItemId, coupon: props === null || props === void 0 ? void 0 : props.coupon });
896
889
  if (typeof formatter === 'function') {
897
890
  const formattedPayload = formatter(props, payload);
@@ -900,13 +893,13 @@ export class ChordAnalytics {
900
893
  return this.track('Variant Clicked', payload, options);
901
894
  });
902
895
  this.trackProductListFiltered = (props, options) => __awaiter(this, void 0, void 0, function* () {
903
- var _60, _61, _62, _63, _64;
904
- const formatter = (_62 = (_61 = (_60 = this.options) === null || _60 === void 0 ? void 0 : _60.formatters) === null || _61 === void 0 ? void 0 : _61.events) === null || _62 === void 0 ? void 0 : _62.productListFiltered;
896
+ var _57, _58, _59, _60, _61;
897
+ const formatter = (_59 = (_58 = (_57 = this.options) === null || _57 === void 0 ? void 0 : _57.formatters) === null || _58 === void 0 ? void 0 : _58.events) === null || _59 === void 0 ? void 0 : _59.productListFiltered;
905
898
  const payload = {
906
899
  category: props === null || props === void 0 ? void 0 : props.category,
907
900
  filters: props === null || props === void 0 ? void 0 : props.filters,
908
- list_id: (_63 = props === null || props === void 0 ? void 0 : props.listId) === null || _63 === void 0 ? void 0 : _63.toString(),
909
- item_list_id: (_64 = props === null || props === void 0 ? void 0 : props.listId) === null || _64 === void 0 ? void 0 : _64.toString(),
901
+ list_id: (_60 = props === null || props === void 0 ? void 0 : props.listId) === null || _60 === void 0 ? void 0 : _60.toString(),
902
+ item_list_id: (_61 = props === null || props === void 0 ? void 0 : props.listId) === null || _61 === void 0 ? void 0 : _61.toString(),
910
903
  item_list_name: props === null || props === void 0 ? void 0 : props.listName,
911
904
  sorts: props === null || props === void 0 ? void 0 : props.sorts,
912
905
  };
@@ -917,14 +910,14 @@ export class ChordAnalytics {
917
910
  return this.track('Product List Filtered', payload, options);
918
911
  });
919
912
  this.trackProductListViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
920
- var _65, _66, _67, _68, _69, _70;
921
- const formatter = (_67 = (_66 = (_65 = this.options) === null || _65 === void 0 ? void 0 : _65.formatters) === null || _66 === void 0 ? void 0 : _66.events) === null || _67 === void 0 ? void 0 : _67.productListViewed;
913
+ var _62, _63, _64, _65, _66, _67;
914
+ const formatter = (_64 = (_63 = (_62 = this.options) === null || _62 === void 0 ? void 0 : _62.formatters) === null || _63 === void 0 ? void 0 : _63.events) === null || _64 === void 0 ? void 0 : _64.productListViewed;
922
915
  const payload = {
923
916
  category: props === null || props === void 0 ? void 0 : props.category,
924
- list_id: (_68 = props === null || props === void 0 ? void 0 : props.listId) === null || _68 === void 0 ? void 0 : _68.toString(),
925
- item_list_id: (_69 = props === null || props === void 0 ? void 0 : props.listId) === null || _69 === void 0 ? void 0 : _69.toString(),
917
+ list_id: (_65 = props === null || props === void 0 ? void 0 : props.listId) === null || _65 === void 0 ? void 0 : _65.toString(),
918
+ item_list_id: (_66 = props === null || props === void 0 ? void 0 : props.listId) === null || _66 === void 0 ? void 0 : _66.toString(),
926
919
  item_list_name: props === null || props === void 0 ? void 0 : props.listName,
927
- products: (_70 = props === null || props === void 0 ? void 0 : props.products) === null || _70 === void 0 ? void 0 : _70.map((p, i) => {
920
+ products: (_67 = props === null || props === void 0 ? void 0 : props.products) === null || _67 === void 0 ? void 0 : _67.map((p, i) => {
928
921
  var _a, _b, _c, _d;
929
922
  return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
930
923
  }),
@@ -937,8 +930,8 @@ export class ChordAnalytics {
937
930
  return this.track('Product List Viewed', payload, options);
938
931
  });
939
932
  this.trackProductRemoved = (props, options) => __awaiter(this, void 0, void 0, function* () {
940
- var _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85;
941
- const formatter = (_73 = (_72 = (_71 = this.options) === null || _71 === void 0 ? void 0 : _71.formatters) === null || _72 === void 0 ? void 0 : _72.events) === null || _73 === void 0 ? void 0 : _73.productRemoved;
933
+ var _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82;
934
+ const formatter = (_70 = (_69 = (_68 = this.options) === null || _68 === void 0 ? void 0 : _68.formatters) === null || _69 === void 0 ? void 0 : _69.events) === null || _70 === void 0 ? void 0 : _70.productRemoved;
942
935
  /*
943
936
  const product = this.options?.formatters?.objects?.product?.({
944
937
  position: props?.position,
@@ -947,13 +940,13 @@ export class ChordAnalytics {
947
940
  variantId: props?.variantId,
948
941
  })
949
942
  */
950
- const lineItem = (_77 = (_76 = (_75 = (_74 = this.options) === null || _74 === void 0 ? void 0 : _74.formatters) === null || _75 === void 0 ? void 0 : _75.objects) === null || _76 === void 0 ? void 0 : _76.lineItem) === null || _77 === void 0 ? void 0 : _77.call(_76, {
943
+ const lineItem = (_74 = (_73 = (_72 = (_71 = this.options) === null || _71 === void 0 ? void 0 : _71.formatters) === null || _72 === void 0 ? void 0 : _72.objects) === null || _73 === void 0 ? void 0 : _73.lineItem) === null || _74 === void 0 ? void 0 : _74.call(_73, {
951
944
  lineItem: props === null || props === void 0 ? void 0 : props.lineItem,
952
945
  });
953
- const cart = (_81 = (_80 = (_79 = (_78 = this.options) === null || _78 === void 0 ? void 0 : _78.formatters) === null || _79 === void 0 ? void 0 : _79.objects) === null || _80 === void 0 ? void 0 : _80.cart) === null || _81 === void 0 ? void 0 : _81.call(_80, {
946
+ const cart = (_78 = (_77 = (_76 = (_75 = this.options) === null || _75 === void 0 ? void 0 : _75.formatters) === null || _76 === void 0 ? void 0 : _76.objects) === null || _77 === void 0 ? void 0 : _77.cart) === null || _78 === void 0 ? void 0 : _78.call(_77, {
954
947
  cart: props === null || props === void 0 ? void 0 : props.cart,
955
948
  });
956
- const payload = Object.assign(Object.assign({}, lineItem), { cart_id: cart.cart_id, currency: cart.currency, products: [lineItem], total: ((_82 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _82 !== void 0 ? _82 : 0) * ((_83 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _83 !== void 0 ? _83 : 1), value: ((_84 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _84 !== void 0 ? _84 : 0) * ((_85 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _85 !== void 0 ? _85 : 1) });
949
+ const payload = Object.assign(Object.assign({}, lineItem), { cart_id: cart.cart_id, currency: cart.currency, products: [lineItem], total: ((_79 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _79 !== void 0 ? _79 : 0) * ((_80 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _80 !== void 0 ? _80 : 1), value: ((_81 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _81 !== void 0 ? _81 : 0) * ((_82 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _82 !== void 0 ? _82 : 1) });
957
950
  if (typeof formatter === 'function') {
958
951
  const formattedPayload = formatter(props, payload);
959
952
  return this.track('Product Removed', formattedPayload, options);
@@ -961,14 +954,14 @@ export class ChordAnalytics {
961
954
  return this.track('Product Removed', payload, options);
962
955
  });
963
956
  this.trackProductViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
964
- var _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98;
965
- const formatter = (_88 = (_87 = (_86 = this.options) === null || _86 === void 0 ? void 0 : _86.formatters) === null || _87 === void 0 ? void 0 : _87.events) === null || _88 === void 0 ? void 0 : _88.productViewed;
966
- const product = (_92 = (_91 = (_90 = (_89 = this.options) === null || _89 === void 0 ? void 0 : _89.formatters) === null || _90 === void 0 ? void 0 : _90.objects) === null || _91 === void 0 ? void 0 : _91.product) === null || _92 === void 0 ? void 0 : _92.call(_91, props === null || props === void 0 ? void 0 : props.product);
967
- const cart = (_96 = (_95 = (_94 = (_93 = this.options) === null || _93 === void 0 ? void 0 : _93.formatters) === null || _94 === void 0 ? void 0 : _94.objects) === null || _95 === void 0 ? void 0 : _95.cart) === null || _96 === void 0 ? void 0 : _96.call(_95, {
957
+ var _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95;
958
+ const formatter = (_85 = (_84 = (_83 = this.options) === null || _83 === void 0 ? void 0 : _83.formatters) === null || _84 === void 0 ? void 0 : _84.events) === null || _85 === void 0 ? void 0 : _85.productViewed;
959
+ const product = (_89 = (_88 = (_87 = (_86 = this.options) === null || _86 === void 0 ? void 0 : _86.formatters) === null || _87 === void 0 ? void 0 : _87.objects) === null || _88 === void 0 ? void 0 : _88.product) === null || _89 === void 0 ? void 0 : _89.call(_88, props === null || props === void 0 ? void 0 : props.product);
960
+ const cart = (_93 = (_92 = (_91 = (_90 = this.options) === null || _90 === void 0 ? void 0 : _90.formatters) === null || _91 === void 0 ? void 0 : _91.objects) === null || _92 === void 0 ? void 0 : _92.cart) === null || _93 === void 0 ? void 0 : _93.call(_92, {
968
961
  cart: props === null || props === void 0 ? void 0 : props.cart,
969
962
  });
970
- const quantity = ((_97 = props === null || props === void 0 ? void 0 : props.product) === null || _97 === void 0 ? void 0 : _97.quantity) || 1;
971
- const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], value: product.price * (((_98 = props === null || props === void 0 ? void 0 : props.product) === null || _98 === void 0 ? void 0 : _98.quantity) || 1) });
963
+ const quantity = ((_94 = props === null || props === void 0 ? void 0 : props.product) === null || _94 === void 0 ? void 0 : _94.quantity) || 1;
964
+ const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], value: product.price * (((_95 = props === null || props === void 0 ? void 0 : props.product) === null || _95 === void 0 ? void 0 : _95.quantity) || 1) });
972
965
  if (typeof formatter === 'function') {
973
966
  const formattedPayload = formatter(props, payload);
974
967
  return this.track('Product Viewed', formattedPayload, options);
@@ -976,12 +969,12 @@ export class ChordAnalytics {
976
969
  return this.track('Product Viewed', payload, options);
977
970
  });
978
971
  this.trackProductsSearched = (props, options) => __awaiter(this, void 0, void 0, function* () {
979
- var _99, _100, _101, _102;
980
- const formatter = (_101 = (_100 = (_99 = this.options) === null || _99 === void 0 ? void 0 : _99.formatters) === null || _100 === void 0 ? void 0 : _100.events) === null || _101 === void 0 ? void 0 : _101.productsSearched;
972
+ var _96, _97, _98, _99;
973
+ const formatter = (_98 = (_97 = (_96 = this.options) === null || _96 === void 0 ? void 0 : _96.formatters) === null || _97 === void 0 ? void 0 : _97.events) === null || _98 === void 0 ? void 0 : _98.productsSearched;
981
974
  const payload = {
982
975
  currency: props === null || props === void 0 ? void 0 : props.currency,
983
976
  price: typeof (props === null || props === void 0 ? void 0 : props.price) !== 'undefined' ? Number(props === null || props === void 0 ? void 0 : props.price) : undefined,
984
- product_id: (_102 = props === null || props === void 0 ? void 0 : props.productId) === null || _102 === void 0 ? void 0 : _102.toString(),
977
+ product_id: (_99 = props === null || props === void 0 ? void 0 : props.productId) === null || _99 === void 0 ? void 0 : _99.toString(),
985
978
  quantity: props === null || props === void 0 ? void 0 : props.quantity,
986
979
  query: props === null || props === void 0 ? void 0 : props.query,
987
980
  };
@@ -992,8 +985,8 @@ export class ChordAnalytics {
992
985
  return this.track('Products Searched', payload, options);
993
986
  });
994
987
  this.trackSignedIn = (props, options) => __awaiter(this, void 0, void 0, function* () {
995
- var _103, _104, _105;
996
- const formatter = (_105 = (_104 = (_103 = this.options) === null || _103 === void 0 ? void 0 : _103.formatters) === null || _104 === void 0 ? void 0 : _104.events) === null || _105 === void 0 ? void 0 : _105.signedIn;
988
+ var _100, _101, _102;
989
+ const formatter = (_102 = (_101 = (_100 = this.options) === null || _100 === void 0 ? void 0 : _100.formatters) === null || _101 === void 0 ? void 0 : _101.events) === null || _102 === void 0 ? void 0 : _102.signedIn;
997
990
  const payload = {
998
991
  email: props === null || props === void 0 ? void 0 : props.email,
999
992
  method: props === null || props === void 0 ? void 0 : props.method,
@@ -1005,8 +998,8 @@ export class ChordAnalytics {
1005
998
  return this.track('Signed In', payload, options);
1006
999
  });
1007
1000
  this.trackSignedOut = (props, options) => __awaiter(this, void 0, void 0, function* () {
1008
- var _106, _107, _108;
1009
- const formatter = (_108 = (_107 = (_106 = this.options) === null || _106 === void 0 ? void 0 : _106.formatters) === null || _107 === void 0 ? void 0 : _107.events) === null || _108 === void 0 ? void 0 : _108.signedOut;
1001
+ var _103, _104, _105;
1002
+ const formatter = (_105 = (_104 = (_103 = this.options) === null || _103 === void 0 ? void 0 : _103.formatters) === null || _104 === void 0 ? void 0 : _104.events) === null || _105 === void 0 ? void 0 : _105.signedOut;
1010
1003
  const payload = {
1011
1004
  email: props === null || props === void 0 ? void 0 : props.email,
1012
1005
  };
@@ -1017,8 +1010,8 @@ export class ChordAnalytics {
1017
1010
  return this.track('Signed Out', payload, options);
1018
1011
  });
1019
1012
  this.trackSignedUp = (props, options) => __awaiter(this, void 0, void 0, function* () {
1020
- var _109, _110, _111;
1021
- const formatter = (_111 = (_110 = (_109 = this.options) === null || _109 === void 0 ? void 0 : _109.formatters) === null || _110 === void 0 ? void 0 : _110.events) === null || _111 === void 0 ? void 0 : _111.signedUp;
1013
+ var _106, _107, _108;
1014
+ const formatter = (_108 = (_107 = (_106 = this.options) === null || _106 === void 0 ? void 0 : _106.formatters) === null || _107 === void 0 ? void 0 : _107.events) === null || _108 === void 0 ? void 0 : _108.signedUp;
1022
1015
  const payload = {
1023
1016
  email: props === null || props === void 0 ? void 0 : props.email,
1024
1017
  method: props === null || props === void 0 ? void 0 : props.method,
@@ -1030,8 +1023,8 @@ export class ChordAnalytics {
1030
1023
  return this.track('Signed Up', payload, options);
1031
1024
  });
1032
1025
  this.trackLoginStarted = (props, options) => __awaiter(this, void 0, void 0, function* () {
1033
- var _112, _113, _114;
1034
- const formatter = (_114 = (_113 = (_112 = this.options) === null || _112 === void 0 ? void 0 : _112.formatters) === null || _113 === void 0 ? void 0 : _113.events) === null || _114 === void 0 ? void 0 : _114.loginStarted;
1026
+ var _109, _110, _111;
1027
+ const formatter = (_111 = (_110 = (_109 = this.options) === null || _109 === void 0 ? void 0 : _109.formatters) === null || _110 === void 0 ? void 0 : _110.events) === null || _111 === void 0 ? void 0 : _111.loginStarted;
1035
1028
  const payload = {
1036
1029
  email: props === null || props === void 0 ? void 0 : props.email,
1037
1030
  };
@@ -1042,8 +1035,8 @@ export class ChordAnalytics {
1042
1035
  return this.track('Login Started', payload, options);
1043
1036
  });
1044
1037
  this.trackSubscriptionCancelled = (props, options) => __awaiter(this, void 0, void 0, function* () {
1045
- var _115, _116, _117, _118;
1046
- const formatter = (_117 = (_116 = (_115 = this.options) === null || _115 === void 0 ? void 0 : _115.formatters) === null || _116 === void 0 ? void 0 : _116.events) === null || _117 === void 0 ? void 0 : _117.subscriptionCancelled;
1038
+ var _112, _113, _114, _115;
1039
+ const formatter = (_114 = (_113 = (_112 = this.options) === null || _112 === void 0 ? void 0 : _112.formatters) === null || _113 === void 0 ? void 0 : _113.events) === null || _114 === void 0 ? void 0 : _114.subscriptionCancelled;
1047
1040
  const payload = {
1048
1041
  actionable_date: props === null || props === void 0 ? void 0 : props.actionableDate,
1049
1042
  address: props === null || props === void 0 ? void 0 : props.address,
@@ -1052,7 +1045,7 @@ export class ChordAnalytics {
1052
1045
  end_date: props === null || props === void 0 ? void 0 : props.endDate,
1053
1046
  interval_length: props === null || props === void 0 ? void 0 : props.intervalLength,
1054
1047
  interval_units: props === null || props === void 0 ? void 0 : props.intervalUnits,
1055
- products: (_118 = props === null || props === void 0 ? void 0 : props.products) === null || _118 === void 0 ? void 0 : _118.map((p, i) => {
1048
+ products: (_115 = props === null || props === void 0 ? void 0 : props.products) === null || _115 === void 0 ? void 0 : _115.map((p, i) => {
1056
1049
  var _a, _b, _c, _d;
1057
1050
  return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
1058
1051
  }),
@@ -1067,8 +1060,8 @@ export class ChordAnalytics {
1067
1060
  return this.track('Subscription Cancelled', payload, options);
1068
1061
  });
1069
1062
  this.trackNavigationClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
1070
- var _119, _120, _121;
1071
- const formatter = (_121 = (_120 = (_119 = this.options) === null || _119 === void 0 ? void 0 : _119.formatters) === null || _120 === void 0 ? void 0 : _120.events) === null || _121 === void 0 ? void 0 : _121.navigationClicked;
1063
+ var _116, _117, _118;
1064
+ const formatter = (_118 = (_117 = (_116 = this.options) === null || _116 === void 0 ? void 0 : _116.formatters) === null || _117 === void 0 ? void 0 : _117.events) === null || _118 === void 0 ? void 0 : _118.navigationClicked;
1072
1065
  const payload = {
1073
1066
  category: props === null || props === void 0 ? void 0 : props.category,
1074
1067
  label: props === null || props === void 0 ? void 0 : props.label,
@@ -1083,15 +1076,15 @@ export class ChordAnalytics {
1083
1076
  return this.track('Navigation Clicked', payload, options);
1084
1077
  });
1085
1078
  this.trackPaymentInfoEntered = (props, options) => __awaiter(this, void 0, void 0, function* () {
1086
- var _122, _123, _124, _125;
1087
- const formatter = (_124 = (_123 = (_122 = this.options) === null || _122 === void 0 ? void 0 : _122.formatters) === null || _123 === void 0 ? void 0 : _123.events) === null || _124 === void 0 ? void 0 : _124.paymentInfoEntered;
1079
+ var _119, _120, _121, _122;
1080
+ const formatter = (_121 = (_120 = (_119 = this.options) === null || _119 === void 0 ? void 0 : _119.formatters) === null || _120 === void 0 ? void 0 : _120.events) === null || _121 === void 0 ? void 0 : _121.paymentInfoEntered;
1088
1081
  const payload = {
1089
1082
  checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
1090
1083
  coupon: props === null || props === void 0 ? void 0 : props.coupon,
1091
1084
  currency: props === null || props === void 0 ? void 0 : props.currency,
1092
1085
  order_id: props === null || props === void 0 ? void 0 : props.orderId,
1093
1086
  payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
1094
- products: (_125 = props === null || props === void 0 ? void 0 : props.products) === null || _125 === void 0 ? void 0 : _125.map((p, i) => {
1087
+ products: (_122 = props === null || props === void 0 ? void 0 : props.products) === null || _122 === void 0 ? void 0 : _122.map((p, i) => {
1095
1088
  var _a, _b, _c, _d;
1096
1089
  return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
1097
1090
  }),
@@ -1106,8 +1099,8 @@ export class ChordAnalytics {
1106
1099
  return this.track('Payment Info Entered', payload, options);
1107
1100
  });
1108
1101
  this.trackOrderCompleted = (props, options) => __awaiter(this, void 0, void 0, function* () {
1109
- var _126, _127, _128, _129;
1110
- const formatter = (_128 = (_127 = (_126 = this.options) === null || _126 === void 0 ? void 0 : _126.formatters) === null || _127 === void 0 ? void 0 : _127.events) === null || _128 === void 0 ? void 0 : _128.orderCompleted;
1102
+ var _123, _124, _125, _126;
1103
+ const formatter = (_125 = (_124 = (_123 = this.options) === null || _123 === void 0 ? void 0 : _123.formatters) === null || _124 === void 0 ? void 0 : _124.events) === null || _125 === void 0 ? void 0 : _125.orderCompleted;
1111
1104
  const payload = {
1112
1105
  affiliation: props === null || props === void 0 ? void 0 : props.affiliation,
1113
1106
  campaign_id: props === null || props === void 0 ? void 0 : props.campaignId,
@@ -1127,7 +1120,7 @@ export class ChordAnalytics {
1127
1120
  order_date: props === null || props === void 0 ? void 0 : props.orderDate,
1128
1121
  order_id: props === null || props === void 0 ? void 0 : props.orderId,
1129
1122
  phone: props === null || props === void 0 ? void 0 : props.phone,
1130
- products: (_129 = props === null || props === void 0 ? void 0 : props.products) === null || _129 === void 0 ? void 0 : _129.map((p, i) => {
1123
+ products: (_126 = props === null || props === void 0 ? void 0 : props.products) === null || _126 === void 0 ? void 0 : _126.map((p, i) => {
1131
1124
  var _a;
1132
1125
  return ({
1133
1126
  affiliation: p === null || p === void 0 ? void 0 : p.affiliation,
@@ -1207,12 +1200,6 @@ export class ChordAnalytics {
1207
1200
  if (shouldEnableWebPixel) {
1208
1201
  this.setupWebPixelListener();
1209
1202
  }
1210
- // Sync identifiers to cart: explicit true/false takes precedence,
1211
- // otherwise auto-detect by checking for window.Shopify.shop (Liquid storefront)
1212
- const shouldEnableIdentifierSync = (_f = (_e = this.options) === null || _e === void 0 ? void 0 : _e.enableIdentifierSync) !== null && _f !== void 0 ? _f : (typeof window !== 'undefined' && !!((_g = window.Shopify) === null || _g === void 0 ? void 0 : _g.shop));
1213
- if (shouldEnableIdentifierSync) {
1214
- this.syncIdentifiersToCart();
1215
- }
1216
1203
  }
1217
1204
  /**
1218
1205
  * Initialize CDP snippet and wait for it to be ready.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './client/index.js';
2
- export * from './client/identifiers.js';
3
2
  export * from './types/index.js';
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './client/index.js';
2
- export * from './client/identifiers.js';
3
2
  export * from './types/index.js';
@@ -34,20 +34,7 @@ export interface ChordAnalyticsOptions<T extends ObjectTypes = ObjectTypes> {
34
34
  awaitConsent?: boolean;
35
35
  debug?: boolean;
36
36
  enableLogging?: boolean;
37
- /**
38
- * Controls the postMessage listener for events from the Shopify Custom Web
39
- * Pixel sandbox. Enabled by default in browser environments. The listener
40
- * only processes messages with source === 'chord-web-pixel', so it is safe
41
- * to leave enabled on non-Shopify sites. Set to false to explicitly disable.
42
- */
43
37
  enableWebPixelListener?: boolean;
44
- /**
45
- * Controls syncing CDP anonymous ID and Google Client ID to Shopify cart
46
- * attributes. When true, always enables sync. When false, always disables it.
47
- * When undefined (default), auto-detects by checking for window.Shopify.shop
48
- * which is present on Shopify Liquid storefronts.
49
- */
50
- enableIdentifierSync?: boolean;
51
38
  formatters: ChordAnalyticsFormatters<T>;
52
39
  namespace?: string;
53
40
  stripNull?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chordcommerce/analytics",
3
3
  "description": "Chord Commerce event tracking",
4
- "version": "1.22.0-beta.3",
4
+ "version": "1.22.1-beta.1",
5
5
  "author": "Chord Commerce <help@chord.co> (https://www.chord.co)",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",