@zonos/elements 1.3.247 → 1.3.248

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.
Files changed (149) hide show
  1. package/dist/cjs/{cart-97a2d20a.js → cart-28310848.js} +2 -0
  2. package/dist/cjs/index.cjs.js +14 -7
  3. package/dist/cjs/{invoice-05a10ee1.js → invoice-2e8e5879.js} +1 -1
  4. package/dist/cjs/{isCollectMobileTablet-edd4804c.js → isCollectMobileTablet-bd0f4556.js} +1 -1
  5. package/dist/cjs/{paypal-0b4b352b.js → paypal-3019ae94.js} +21 -18
  6. package/dist/cjs/{placeTestOrder-07b46688.js → placeTestOrder-b0369cfd.js} +1 -1
  7. package/dist/cjs/{renderCheckoutCurrency-dd3b0609.js → renderCheckoutCurrency-9e919b9f.js} +1 -1
  8. package/dist/cjs/submitGtag-a50ab32e.js +116 -0
  9. package/dist/cjs/zonos-address-display_9.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-address_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -2
  12. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +109 -17
  13. package/dist/cjs/zonos-checkout.cjs.entry.js +27 -6
  14. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +12 -11
  16. package/dist/cjs/zonos-collect.cjs.entry.js +4 -3
  17. package/dist/cjs/zonos-controller.cjs.entry.js +5 -2
  18. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +3 -3
  19. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +12 -11
  20. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -3
  21. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +88 -9
  22. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +9 -2
  23. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +24 -4
  24. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +9 -3
  25. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +5 -5
  26. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
  27. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +5 -5
  28. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
  29. package/dist/collection/components/main/zonos-controller.js +4 -1
  30. package/dist/collection/components/store/checkout/paypal.js +19 -1
  31. package/dist/collection/components/store/checkout/stripe.js +2 -0
  32. package/dist/collection/components/utils/submitGtag.js +90 -2
  33. package/dist/collection/scripts/_zonosBase.js +7 -0
  34. package/dist/collection/types/analyticsRelay.js +6 -0
  35. package/dist/esm/{cart-99ec4a3d.js → cart-ba8f3890.js} +2 -0
  36. package/dist/esm/index.js +14 -7
  37. package/dist/esm/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
  38. package/dist/esm/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
  39. package/dist/esm/{paypal-56534e48.js → paypal-8d8518c0.js} +23 -19
  40. package/dist/esm/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
  41. package/dist/esm/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
  42. package/dist/esm/submitGtag-89d6e9cb.js +113 -0
  43. package/dist/esm/zonos-address-display_9.entry.js +1 -1
  44. package/dist/esm/zonos-address_4.entry.js +1 -1
  45. package/dist/esm/zonos-card_5.entry.js +3 -2
  46. package/dist/esm/zonos-cart-items_12.entry.js +109 -17
  47. package/dist/esm/zonos-checkout.entry.js +27 -6
  48. package/dist/esm/zonos-collect-cart-items_3.entry.js +1 -1
  49. package/dist/esm/zonos-collect-finish_6.entry.js +12 -11
  50. package/dist/esm/zonos-collect.entry.js +4 -3
  51. package/dist/esm/zonos-controller.entry.js +5 -2
  52. package/dist/esm/zonos-invoice-cart-items_2.entry.js +3 -3
  53. package/dist/esm/zonos-invoice-finish_5.entry.js +12 -11
  54. package/dist/esm/zonos-invoice.entry.js +4 -3
  55. package/dist/esm-es5/{cart-99ec4a3d.js → cart-ba8f3890.js} +1 -1
  56. package/dist/esm-es5/index.js +1 -1
  57. package/dist/esm-es5/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
  58. package/dist/esm-es5/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
  59. package/dist/esm-es5/paypal-8d8518c0.js +17 -0
  60. package/dist/esm-es5/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
  61. package/dist/esm-es5/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
  62. package/dist/esm-es5/submitGtag-89d6e9cb.js +1 -0
  63. package/dist/esm-es5/zonos-address-display_9.entry.js +1 -1
  64. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  65. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  66. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  67. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  68. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  69. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  70. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  71. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  72. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  73. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  74. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  75. package/dist/scripts/analyticsRelayOnInit.js +1 -0
  76. package/dist/scripts/index.d.ts +11 -0
  77. package/dist/scripts/index.js +1 -1
  78. package/dist/scripts/loadZonos.js +1 -1
  79. package/dist/scripts/zonos.js +1 -1
  80. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +4 -0
  81. package/dist/types/components/store/checkout/stripe.d.ts +6 -0
  82. package/dist/types/components/utils/submitGtag.d.ts +32 -2
  83. package/dist/types/scripts/_zonosBase.d.ts +11 -0
  84. package/dist/types/types/analyticsRelay.d.ts +12 -0
  85. package/dist/zonos-elements/index.esm.js +1 -1
  86. package/dist/zonos-elements/p-002e45f9.system.js +17 -0
  87. package/dist/zonos-elements/p-0792688d.system.entry.js +1 -0
  88. package/dist/zonos-elements/p-0b7beb16.system.entry.js +1 -0
  89. package/dist/zonos-elements/p-0f787f5d.entry.js +1 -0
  90. package/dist/zonos-elements/{p-2e8f842c.entry.js → p-0ff93ca6.entry.js} +1 -1
  91. package/dist/zonos-elements/{p-10355cf6.system.entry.js → p-1acf0a71.system.entry.js} +1 -1
  92. package/dist/zonos-elements/p-291f7ccb.system.entry.js +1 -0
  93. package/dist/zonos-elements/p-3972663a.system.entry.js +1 -0
  94. package/dist/zonos-elements/{p-53a9da45.entry.js → p-39fa55c7.entry.js} +1 -1
  95. package/dist/zonos-elements/{p-f6f1d779.system.entry.js → p-3e85b9f5.system.entry.js} +1 -1
  96. package/dist/zonos-elements/p-48475755.entry.js +1 -0
  97. package/dist/zonos-elements/{p-d0411b2d.entry.js → p-58248f03.entry.js} +1 -1
  98. package/dist/zonos-elements/p-5edef7c3.system.js +1 -0
  99. package/dist/zonos-elements/{p-678331f0.system.js → p-63a3d3b9.system.js} +1 -1
  100. package/dist/zonos-elements/p-64661dd1.js +1 -0
  101. package/dist/zonos-elements/p-69212d0f.entry.js +1 -0
  102. package/dist/zonos-elements/{p-71185d24.system.js → p-719403e0.system.js} +1 -1
  103. package/dist/zonos-elements/{p-382601a9.system.entry.js → p-71a8d971.system.entry.js} +1 -1
  104. package/dist/zonos-elements/p-71d855b8.system.entry.js +1 -0
  105. package/dist/zonos-elements/p-71f10bf0.entry.js +1 -0
  106. package/dist/zonos-elements/p-72ff005c.entry.js +1 -0
  107. package/dist/zonos-elements/{p-08365fdb.system.js → p-7dba5f23.system.js} +1 -1
  108. package/dist/zonos-elements/p-85e59f3a.system.entry.js +1 -0
  109. package/dist/zonos-elements/{p-ce98e472.js → p-866afec1.js} +1 -1
  110. package/dist/zonos-elements/p-942358eb.system.js +1 -0
  111. package/dist/zonos-elements/{p-2c10b067.system.entry.js → p-94c5fbfc.system.entry.js} +1 -1
  112. package/dist/zonos-elements/p-a12cb7ce.entry.js +1 -0
  113. package/dist/zonos-elements/p-abf38ed6.js +1 -0
  114. package/dist/zonos-elements/{p-df6e62f8.system.js → p-ae16dda9.system.js} +1 -1
  115. package/dist/zonos-elements/{p-46ece7ae.js → p-bc4bfa06.js} +1 -1
  116. package/dist/zonos-elements/p-bf5e47e2.entry.js +1 -0
  117. package/dist/zonos-elements/{p-dca14319.system.js → p-c027a832.system.js} +1 -1
  118. package/dist/zonos-elements/p-c2442878.system.js +1 -1
  119. package/dist/zonos-elements/p-c2f34b10.system.entry.js +1 -0
  120. package/dist/zonos-elements/p-c36696f9.js +1 -0
  121. package/dist/zonos-elements/p-c7311ce5.system.entry.js +1 -0
  122. package/dist/zonos-elements/{p-1b86711b.js → p-de8899bc.js} +1 -1
  123. package/dist/zonos-elements/p-e17bbcee.entry.js +1 -0
  124. package/dist/zonos-elements/{p-e458f737.entry.js → p-f6c2c743.entry.js} +1 -1
  125. package/dist/zonos-elements/p-fe06c9ea.js +17 -0
  126. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  127. package/package.json +1 -1
  128. package/dist/esm-es5/paypal-56534e48.js +0 -17
  129. package/dist/zonos-elements/p-0c201c39.system.entry.js +0 -1
  130. package/dist/zonos-elements/p-0cb5f151.system.entry.js +0 -1
  131. package/dist/zonos-elements/p-3e2f175c.entry.js +0 -1
  132. package/dist/zonos-elements/p-5295d36e.entry.js +0 -1
  133. package/dist/zonos-elements/p-64870563.entry.js +0 -1
  134. package/dist/zonos-elements/p-695e0803.system.entry.js +0 -1
  135. package/dist/zonos-elements/p-6e3cf6eb.entry.js +0 -1
  136. package/dist/zonos-elements/p-6f430d6f.system.entry.js +0 -1
  137. package/dist/zonos-elements/p-794d29dc.entry.js +0 -1
  138. package/dist/zonos-elements/p-8defdf0d.system.js +0 -17
  139. package/dist/zonos-elements/p-8e98a7c8.js +0 -1
  140. package/dist/zonos-elements/p-95348ebf.system.entry.js +0 -1
  141. package/dist/zonos-elements/p-9a066833.system.entry.js +0 -1
  142. package/dist/zonos-elements/p-aa6c2348.system.entry.js +0 -1
  143. package/dist/zonos-elements/p-ada8841a.js +0 -1
  144. package/dist/zonos-elements/p-c75b7c47.entry.js +0 -1
  145. package/dist/zonos-elements/p-caff391d.system.entry.js +0 -1
  146. package/dist/zonos-elements/p-dd19d9d8.js +0 -17
  147. package/dist/zonos-elements/p-df90bccf.entry.js +0 -1
  148. package/dist/zonos-elements/p-e07aaf09.system.js +0 -1
  149. package/dist/zonos-elements/p-f8eb618b.entry.js +0 -1
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
7
- const paypal = require('./paypal-0b4b352b.js');
6
+ const cart = require('./cart-28310848.js');
7
+ const paypal = require('./paypal-3019ae94.js');
8
8
  const localization = require('./localization-00e73920.js');
9
9
  const zonosStore = require('./zonosStore-37a4b4f4.js');
10
10
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
@@ -17,6 +17,7 @@ const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
17
17
  const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
18
18
  const isDarkColor = require('./isDarkColor-878e600e.js');
19
19
  const styles = require('./styles-d1e64fb9.js');
20
+ const submitGtag = require('./submitGtag-a50ab32e.js');
20
21
  const RemoveIcon = require('./RemoveIcon-081ac073.js');
21
22
  require('./isContrastColor-09f5924a.js');
22
23
  require('./debounce-815d1517.js');
@@ -913,7 +914,12 @@ const ZonosCheckout = class {
913
914
  }
914
915
  // Close the confirm dialog
915
916
  this.confirmDialogOpen = false;
916
- paypal.submitGtag('zonos-checkout-close');
917
+ submitGtag.submitGtag({
918
+ event: 'zonos-checkout-close',
919
+ metadata: {
920
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
921
+ },
922
+ });
917
923
  this.open = this.forceDialogOpen || false;
918
924
  if (!this.preview && cart.cartStore.step === 'finish') {
919
925
  // reset cart store if it's not preview mode and only when checkout is in the finish step.
@@ -1199,7 +1205,12 @@ const ZonosCheckout = class {
1199
1205
  isPreview: this.preview,
1200
1206
  sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
1201
1207
  });
1202
- paypal.submitGtag('zonos-checkout-start');
1208
+ submitGtag.submitGtag({
1209
+ event: 'zonos-checkout-start',
1210
+ metadata: {
1211
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
1212
+ },
1213
+ });
1203
1214
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
1204
1215
  void cart.trackConversionEvent({
1205
1216
  checkoutSessionId,
@@ -1520,7 +1531,12 @@ const ZonosCheckout = class {
1520
1531
  async handleCustomerInfoContinue() {
1521
1532
  var _a, _b, _c, _d;
1522
1533
  // submit google tag when the form is complete
1523
- paypal.submitGtag('zonos-checkout-customer-info');
1534
+ submitGtag.submitGtag({
1535
+ event: 'zonos-checkout-customer-info',
1536
+ metadata: {
1537
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
1538
+ },
1539
+ });
1524
1540
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
1525
1541
  void cart.trackConversionEvent({
1526
1542
  checkoutSessionId,
@@ -1659,7 +1675,12 @@ const ZonosCheckout = class {
1659
1675
  }
1660
1676
  catch (err) {
1661
1677
  handleFetch.logError(err);
1662
- paypal.submitGtag('zonos-checkout-payment-fail');
1678
+ submitGtag.submitGtag({
1679
+ event: 'zonos-checkout-payment-fail',
1680
+ metadata: {
1681
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
1682
+ },
1683
+ });
1663
1684
  cart.stripeStore.hasPaymentError = true;
1664
1685
  // should request inventory refund if there's an error during payment
1665
1686
  if (cart.stripeStore.shouldInventoryRefund) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
6
+ const cart = require('./cart-28310848.js');
7
7
  const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-577d0a77.js');
8
8
  const zonosStore = require('./zonosStore-37a4b4f4.js');
9
9
  const classes = require('./classes-b7918f56.js');
@@ -3,19 +3,20 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
7
- const paypal = require('./paypal-0b4b352b.js');
6
+ const cart = require('./cart-28310848.js');
7
+ const paypal = require('./paypal-3019ae94.js');
8
8
  const localization = require('./localization-00e73920.js');
9
9
  const zonosStore = require('./zonosStore-37a4b4f4.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
11
11
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
12
12
  const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
13
13
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
- const isCollectMobileTablet = require('./isCollectMobileTablet-edd4804c.js');
14
+ const submitGtag = require('./submitGtag-a50ab32e.js');
15
+ const isCollectMobileTablet = require('./isCollectMobileTablet-bd0f4556.js');
15
16
  const classes = require('./classes-b7918f56.js');
16
17
  const ILanguage = require('./ILanguage-98b04442.js');
17
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-dd3b0609.js');
18
- const placeTestOrder = require('./placeTestOrder-07b46688.js');
18
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-9e919b9f.js');
19
+ const placeTestOrder = require('./placeTestOrder-b0369cfd.js');
19
20
  const renderFallback = require('./renderFallback-78b54537.js');
20
21
  require('./isDarkColor-878e600e.js');
21
22
  require('./isContrastColor-09f5924a.js');
@@ -157,7 +158,7 @@ const ZonosCollectFinish = class {
157
158
  window.history.replaceState({}, '', url.toString());
158
159
  // Payment doesn't go through
159
160
  if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
160
- paypal.submitGtag('zonos-checkout-payment-fail');
161
+ submitGtag.submitGtag({ event: 'zonos-checkout-payment-fail' });
161
162
  void handleFetch.sendErrorLog({
162
163
  endpoint: 'Stripe payment failed',
163
164
  errors: [
@@ -170,7 +171,7 @@ const ZonosCollectFinish = class {
170
171
  });
171
172
  }
172
173
  else {
173
- paypal.submitGtag('zonos-checkout-success');
174
+ submitGtag.submitGtag({ event: 'zonos-checkout-success' });
174
175
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
175
176
  void cart.trackConversionEvent({
176
177
  checkoutSessionId,
@@ -215,7 +216,7 @@ const ZonosCollectFinish = class {
215
216
  // show success message right away when order id is already created
216
217
  this.isLoading = false;
217
218
  if (paypal.paypalStore.orderIdCreated) {
218
- paypal.submitGtag('zonos-checkout-success');
219
+ submitGtag.submitGtag({ event: 'zonos-checkout-success' });
219
220
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
220
221
  void cart.trackConversionEvent({
221
222
  checkoutSessionId,
@@ -271,11 +272,11 @@ const ZonosCollectFinish = class {
271
272
  }
272
273
  render() {
273
274
  const cartId = window.Zonos.cartId;
274
- return (index.h(index.Host, { key: 'e145b7396302157ccb515c54f99e50faa8ba45e6', class: "zonos--checkout-finish zonos--elements", style: {
275
+ return (index.h(index.Host, { key: 'c085862ecf1f50752634fb44f99b5cb5d82a9e24', class: "zonos--checkout-finish zonos--elements", style: {
275
276
  '--zonos--border-radius': getBorderRadius.getBorderRadius({
276
277
  overrideBorderStyle: this.borderRadius,
277
278
  }),
278
- } }, !this.isLoading && (index.h("div", { key: 'b9df4788f27c935ba7fc47e7c930cd162c8fbebe', class: "zonos--finish-details" }, index.h("div", { key: 'a510c995880c8698dc98390d0504b70333551c86', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '8f84f87bf2365b85acffefe16e8b10cd9227a6e6', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (index.h("zonos-badge", { key: '0e3f3f71cae6262d6394ad2c5a6d656509b484d5', badgeColor: "gray" }, this.confirmationId)), index.h("zonos-text", { key: 'c769f2ada1e6b421e373aeb4393560a21d6fcffc', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.order && cartId && (index.h("div", { key: '9972858fadd4d2d9c4f00e54921002ea04a5cc51', class: "zonos--button-container" }, index.h("zonos-button", { key: 'fe931a552fc1c43b29a1966736379c3c1d0536f6', onClick: () => {
279
+ } }, !this.isLoading && (index.h("div", { key: '9b30b12c817c3422b355a2f544bbf2908f736c80', class: "zonos--finish-details" }, index.h("div", { key: '697fff3258a6e74d99500ec25f5d3923f8c7cfc2', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '8457c0c9b22c2fb6374b60e492099981026d2690', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (index.h("zonos-badge", { key: '21ab18878abb37a2c37d873c494d71aee3d4ed71', badgeColor: "gray" }, this.confirmationId)), index.h("zonos-text", { key: '389918dd57e6ce5744b7192baa3c06c6db3f70cd', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.order && cartId && (index.h("div", { key: 'cca6b625a6bea62b788cf8dd6bb9e03e6505d81c', class: "zonos--button-container" }, index.h("zonos-button", { key: '0f45987515ae99045e5b449b5b1aaae11d70d9fb', onClick: () => {
279
280
  window.open(this.getReceiptUrl({ cartId }), '_blank');
280
281
  }, size: "lg", variant: "primary" }, localization.translate('View receipt')))))))));
281
282
  }
@@ -497,7 +498,7 @@ const ZonosCollectPayment = class {
497
498
  }
498
499
  cart.stripeStore.checkoutSettlementCurrency = currencyCode;
499
500
  // submit google tag when the form is complete
500
- paypal.submitGtag('zonos-checkout-payment-info');
501
+ submitGtag.submitGtag({ event: 'zonos-checkout-payment-info' });
501
502
  this.continueClicked.emit();
502
503
  };
503
504
  this.copyCardToClipboard = async (cardNumber) => {
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
7
- const isCollectMobileTablet = require('./isCollectMobileTablet-edd4804c.js');
8
- const paypal = require('./paypal-0b4b352b.js');
6
+ const cart = require('./cart-28310848.js');
7
+ const isCollectMobileTablet = require('./isCollectMobileTablet-bd0f4556.js');
8
+ const paypal = require('./paypal-3019ae94.js');
9
9
  const localization = require('./localization-00e73920.js');
10
10
  const zonosStore = require('./zonosStore-37a4b4f4.js');
11
11
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
@@ -17,6 +17,7 @@ const ILanguage = require('./ILanguage-98b04442.js');
17
17
  require('./isDarkColor-878e600e.js');
18
18
  require('./getBorderRadius-2ef1170d.js');
19
19
  require('./isContrastColor-09f5924a.js');
20
+ require('./submitGtag-a50ab32e.js');
20
21
 
21
22
  const ChevronDownIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
22
23
 
@@ -3,12 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
6
+ const cart = require('./cart-28310848.js');
7
7
  const localization = require('./localization-00e73920.js');
8
8
  const zonosStore = require('./zonosStore-37a4b4f4.js');
9
9
  const getGenericSettingsOverride = require('./getGenericSettingsOverride-c0ca32b9.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
11
11
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
12
+ const submitGtag = require('./submitGtag-a50ab32e.js');
12
13
  require('./isDarkColor-878e600e.js');
13
14
  require('./getBorderRadius-2ef1170d.js');
14
15
 
@@ -541,6 +542,8 @@ const ZonosController = class {
541
542
  }
542
543
  document.body.appendChild(scriptToInject);
543
544
  });
545
+ // Custom HTML may set window.Zonos.googleAnalyticId; trigger relay ping so parent configures GA
546
+ submitGtag.ensureAnalyticsRelayPing();
544
547
  }
545
548
  async initGooglePlacesService(settings) {
546
549
  const genericSettings = settings === null || settings === void 0 ? void 0 : settings.genericSettings;
@@ -727,7 +730,7 @@ const ZonosController = class {
727
730
  zonosStore.zonosStore.organizationName = organizationName;
728
731
  }
729
732
  render() {
730
- return index.h(index.Host, { key: 'fe248e1e38cd3d98c56f55d39b704f7337c74c29', class: "zonos--elements" });
733
+ return index.h(index.Host, { key: '92e1eae13d0b13f91098ea110203b6c7a7f67c3e', class: "zonos--elements" });
731
734
  }
732
735
  };
733
736
  ZonosController.style = ZonosControllerStyle0;
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
6
+ const cart = require('./cart-28310848.js');
7
7
  const localization = require('./localization-00e73920.js');
8
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-dd3b0609.js');
8
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-9e919b9f.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
- const invoice = require('./invoice-05a10ee1.js');
10
+ const invoice = require('./invoice-2e8e5879.js');
11
11
  const renderFallback = require('./renderFallback-78b54537.js');
12
12
  require('./zonosStore-37a4b4f4.js');
13
13
  require('./VarianceTest-bec00ea8.js');
@@ -3,20 +3,21 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
7
- const paypal = require('./paypal-0b4b352b.js');
6
+ const cart = require('./cart-28310848.js');
7
+ const paypal = require('./paypal-3019ae94.js');
8
8
  const localization = require('./localization-00e73920.js');
9
9
  const zonosStore = require('./zonosStore-37a4b4f4.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
11
11
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
12
12
  const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
13
13
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
+ const submitGtag = require('./submitGtag-a50ab32e.js');
14
15
  const isInvoiceMobileTablet = require('./isInvoiceMobileTablet-dde41e4e.js');
15
16
  const classes = require('./classes-b7918f56.js');
16
17
  const ILanguage = require('./ILanguage-98b04442.js');
17
- const invoice = require('./invoice-05a10ee1.js');
18
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-dd3b0609.js');
19
- const placeTestOrder = require('./placeTestOrder-07b46688.js');
18
+ const invoice = require('./invoice-2e8e5879.js');
19
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-9e919b9f.js');
20
+ const placeTestOrder = require('./placeTestOrder-b0369cfd.js');
20
21
  const renderFallback = require('./renderFallback-78b54537.js');
21
22
  require('./isDarkColor-878e600e.js');
22
23
  require('./isContrastColor-09f5924a.js');
@@ -158,7 +159,7 @@ const ZonosInvoiceFinish = class {
158
159
  window.history.replaceState({}, '', url.toString());
159
160
  // Payment doesn't go through
160
161
  if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
161
- paypal.submitGtag('zonos-checkout-payment-fail');
162
+ submitGtag.submitGtag({ event: 'zonos-checkout-payment-fail' });
162
163
  void handleFetch.sendErrorLog({
163
164
  endpoint: 'Stripe payment failed',
164
165
  errors: [
@@ -171,7 +172,7 @@ const ZonosInvoiceFinish = class {
171
172
  });
172
173
  }
173
174
  else {
174
- paypal.submitGtag('zonos-checkout-success');
175
+ submitGtag.submitGtag({ event: 'zonos-checkout-success' });
175
176
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
176
177
  void cart.trackConversionEvent({
177
178
  checkoutSessionId,
@@ -216,7 +217,7 @@ const ZonosInvoiceFinish = class {
216
217
  // show success message right away when order id is already created
217
218
  this.isLoading = false;
218
219
  if (paypal.paypalStore.orderIdCreated) {
219
- paypal.submitGtag('zonos-checkout-success');
220
+ submitGtag.submitGtag({ event: 'zonos-checkout-success' });
220
221
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
221
222
  void cart.trackConversionEvent({
222
223
  checkoutSessionId,
@@ -272,11 +273,11 @@ const ZonosInvoiceFinish = class {
272
273
  }
273
274
  render() {
274
275
  const cartId = window.Zonos.cartId;
275
- return (index.h(index.Host, { key: '2d8d736241298daa30fdf8935cef67bfa748e2df', class: "zonos--checkout-finish zonos--elements", style: {
276
+ return (index.h(index.Host, { key: '5d2fc87bc549fa2cb6d622e664043bbfe55f8b0e', class: "zonos--checkout-finish zonos--elements", style: {
276
277
  '--zonos--border-radius': getBorderRadius.getBorderRadius({
277
278
  overrideBorderStyle: this.borderRadius,
278
279
  }),
279
- } }, !this.isLoading && (index.h("div", { key: '30e1eae6e9ac7289af88f8fe2048d40796dfdf0e', class: "zonos--finish-details" }, index.h("div", { key: '0324e34b72e58d0862ed319576018bd45bd18b18', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '227f3cdda8e9cb0ed15ea91acb88c88d15d3d21c', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (index.h("zonos-badge", { key: '1458ad439dc56e9ca7641a9ca95f3dfb2fd6b28f', badgeColor: "gray" }, this.confirmationId)), index.h("zonos-text", { key: '8b0ab258c7beab09b0bc12999198f38813a144b3', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.order && cartId && (index.h("div", { key: 'ea6b4f8c1f8cce779fadf358966fece018d9869b', class: "zonos--button-container" }, index.h("zonos-button", { key: 'e5140fa1fab1e3150a2b15915c29d988f54468b2', onClick: () => {
280
+ } }, !this.isLoading && (index.h("div", { key: '1268de9e5be1edc4cbe2e7e2f1d2590b168d8c7b', class: "zonos--finish-details" }, index.h("div", { key: 'ce63ee565c176ea5687fc1c0f721932e26b93ebd', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: 'a073858eac699426dc5947b85d3b3665868f164e', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (index.h("zonos-badge", { key: 'a96c40f5cc977de82585f7827d6bc6aef55ba873', badgeColor: "gray" }, this.confirmationId)), index.h("zonos-text", { key: 'd97bc54085b9fe69eb05b44042deae25c379ee3a', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.order && cartId && (index.h("div", { key: '488c3442e40fedf65caedbd3e098bd8b95976aab', class: "zonos--button-container" }, index.h("zonos-button", { key: '9a01b9cca0e3747548d386345015ecea80dc29d3', onClick: () => {
280
281
  window.open(this.getReceiptUrl({ cartId }), '_blank');
281
282
  }, size: "lg", variant: "primary" }, localization.translate('View receipt')))))))));
282
283
  }
@@ -478,7 +479,7 @@ const ZonosInvoicePayment = class {
478
479
  }
479
480
  cart.stripeStore.checkoutSettlementCurrency = currencyCode;
480
481
  // submit google tag when the form is complete
481
- paypal.submitGtag('zonos-checkout-payment-info');
482
+ submitGtag.submitGtag({ event: 'zonos-checkout-payment-info' });
482
483
  this.continueClicked.emit();
483
484
  };
484
485
  this.copyCardToClipboard = async (cardNumber) => {
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
7
- const invoice = require('./invoice-05a10ee1.js');
8
- const paypal = require('./paypal-0b4b352b.js');
6
+ const cart = require('./cart-28310848.js');
7
+ const invoice = require('./invoice-2e8e5879.js');
8
+ const paypal = require('./paypal-3019ae94.js');
9
9
  const localization = require('./localization-00e73920.js');
10
10
  const zonosStore = require('./zonosStore-37a4b4f4.js');
11
11
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
@@ -17,6 +17,7 @@ const ILanguage = require('./ILanguage-98b04442.js');
17
17
  require('./isDarkColor-878e600e.js');
18
18
  require('./getBorderRadius-2ef1170d.js');
19
19
  require('./isContrastColor-09f5924a.js');
20
+ require('./submitGtag-a50ab32e.js');
20
21
 
21
22
  const ChevronDownIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
22
23
 
@@ -13,7 +13,7 @@ import { handleFetch } from "../../../utils/handleFetch";
13
13
  import { jsonParse } from "../../../utils/jsonParse";
14
14
  import { allLogs, log } from "../../../utils/logging/log";
15
15
  import { sendErrorLog } from "../../../utils/logging/sendErrorLog";
16
- import { submitGtag } from "../../../utils/submitGtag";
16
+ import { submitGtag, } from "../../../utils/submitGtag";
17
17
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
18
18
  import RemoveIcon from "./assets/RemoveIcon.svg";
19
19
  /* Need to use relative import because inline-svg-stencil couldn't resolve absolute path */
@@ -61,6 +61,56 @@ export class ZonosCheckoutFinish {
61
61
  order: json,
62
62
  };
63
63
  };
64
+ /**
65
+ * Metadata for purchase event in GA4
66
+ */
67
+ this.buildPurchaseMetadata = ({ checkoutSessionId, currency, }) => {
68
+ var _a, _b, _c, _d, _e, _f;
69
+ const items = cartStore.items
70
+ .filter(item => item.amount >= 0)
71
+ .map(item => ({
72
+ item_id: item.sku || item.productId || item.name,
73
+ item_name: item.name,
74
+ price: item.amount,
75
+ quantity: item.quantity,
76
+ }));
77
+ /**
78
+ * The value of this parameter should be the sum of all item amounts in the transaction (without shipping and tax).
79
+ * @ref https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#parameters_22
80
+ */
81
+ const subtotal = ((_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.subtotals.items) ||
82
+ ((_b = this.order) === null || _b === void 0 ? void 0 : _b.amountSubtotals.items);
83
+ const currencyCode = ((_c = cartStore.checkoutSession) === null || _c === void 0 ? void 0 : _c.subtotals.presentmentCurrencyCode) ||
84
+ ((_d = this.order) === null || _d === void 0 ? void 0 : _d.currencyCode) ||
85
+ (currency === null || currency === void 0 ? void 0 : currency.toUpperCase());
86
+ // Cart subtotal amount, can be different on the final checkout session/payment intent, therefore only use it if the order/checkout session can not be found.
87
+ const cartSubtotal = items.reduce((acc, item) => acc + item.price * item.quantity, 0);
88
+ const cartCurrency = (_e = cartStore.items.find(Boolean)) === null || _e === void 0 ? void 0 : _e.currencyCode;
89
+ const transactionId = ((_f = this.order) === null || _f === void 0 ? void 0 : _f.id) || checkoutSessionId || new Date().getTime().toString();
90
+ if (currencyCode && subtotal) {
91
+ return {
92
+ currency: currencyCode,
93
+ items,
94
+ transaction_id: transactionId,
95
+ value: subtotal,
96
+ };
97
+ }
98
+ // Use cart currency and subtotal if the order/checkout session can not be found
99
+ if (cartCurrency && cartSubtotal) {
100
+ return {
101
+ currency: cartCurrency,
102
+ items,
103
+ transaction_id: transactionId,
104
+ value: cartSubtotal,
105
+ };
106
+ }
107
+ return {
108
+ currency: undefined,
109
+ items,
110
+ transaction_id: transactionId,
111
+ value: undefined,
112
+ };
113
+ };
64
114
  this.redirectToUrl = (url) => {
65
115
  // reset store and checkout session id before redirecting
66
116
  stripeStoreReset();
@@ -243,7 +293,7 @@ export class ZonosCheckoutFinish {
243
293
  this.checkStripePaymentStatus = async () => {
244
294
  const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
245
295
  if (clientSecret || this.storybookForceStatus) {
246
- const { error, messages, status } = await stripeStoreRetrievePayment({
296
+ const { currency, error, messages, status } = await stripeStoreRetrievePayment({
247
297
  clientSecret,
248
298
  storybookForceStatus: this.storybookForceStatus,
249
299
  });
@@ -269,7 +319,12 @@ export class ZonosCheckoutFinish {
269
319
  window.history.replaceState({}, '', url.toString());
270
320
  // Payment doesn't go through
271
321
  if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
272
- submitGtag('zonos-checkout-payment-fail');
322
+ submitGtag({
323
+ event: 'zonos-checkout-payment-fail',
324
+ metadata: {
325
+ checkoutSessionId: storageStore.checkoutSessionId,
326
+ },
327
+ });
273
328
  void sendErrorLog({
274
329
  endpoint: 'Stripe payment failed',
275
330
  errors: [
@@ -284,8 +339,21 @@ export class ZonosCheckoutFinish {
284
339
  else {
285
340
  // Save new order info in case the user reloads before we get order info
286
341
  this.saveOrderIdForDuplicationIssue();
287
- submitGtag('zonos-checkout-success');
288
342
  const checkoutSessionId = storageStore.checkoutSessionId;
343
+ submitGtag({
344
+ event: 'zonos-checkout-success',
345
+ metadata: this.buildPurchaseMetadata({
346
+ checkoutSessionId: checkoutSessionId || '',
347
+ currency: currency === null || currency === void 0 ? void 0 : currency.toUpperCase(),
348
+ }),
349
+ });
350
+ submitGtag({
351
+ event: 'purchase',
352
+ metadata: this.buildPurchaseMetadata({
353
+ checkoutSessionId: checkoutSessionId || '',
354
+ currency: currency === null || currency === void 0 ? void 0 : currency.toUpperCase(),
355
+ }),
356
+ });
289
357
  void trackConversionEvent({
290
358
  checkoutSessionId,
291
359
  eventName: 'checkout_orderCompleted',
@@ -331,7 +399,18 @@ export class ZonosCheckoutFinish {
331
399
  // show success message right away when order id is already created
332
400
  this.isLoading = false;
333
401
  if (paypalStore.orderIdCreated) {
334
- submitGtag('zonos-checkout-success');
402
+ submitGtag({
403
+ event: 'zonos-checkout-success',
404
+ metadata: this.buildPurchaseMetadata({
405
+ checkoutSessionId: storageStore.checkoutSessionId || '',
406
+ }),
407
+ });
408
+ submitGtag({
409
+ event: 'purchase',
410
+ metadata: this.buildPurchaseMetadata({
411
+ checkoutSessionId: storageStore.checkoutSessionId || '',
412
+ }),
413
+ });
335
414
  const checkoutSessionId = storageStore.checkoutSessionId;
336
415
  void trackConversionEvent({
337
416
  checkoutSessionId,
@@ -393,11 +472,11 @@ export class ZonosCheckoutFinish {
393
472
  }
394
473
  render() {
395
474
  const isTestMode = getIsTestMode();
396
- return (h(Host, { key: '7b18913d8ebe7be5cbe9ee7d520b643c342c409d', class: "zonos--checkout-finish zonos--elements", style: {
475
+ return (h(Host, { key: '80a543fca5dbc63dde41806702b2f6dd4fa849ab', class: "zonos--checkout-finish zonos--elements", style: {
397
476
  '--zonos--border-radius': getBorderRadius({
398
477
  overrideBorderStyle: this.borderRadius,
399
478
  }),
400
- } }, !this.isLoading && (h("div", { key: 'afb522b8b3b769817c00312fc9c14b4c032873ca', class: "zonos--finish-details" }, h("div", { key: 'c8cd43bc5269f7f252abaeb25dc98929f52b89bb', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '1a7ead411d64fc8edf2de0383049bfd60660a315', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: '0c63714bbefc4e9beb1d2cf7414e5774bab4eabe', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '06304d9815e2199108dfcb3dade1494f17b76137',
479
+ } }, !this.isLoading && (h("div", { key: '6cab293041902e156563f37db6f0e77caaeeaaf9', class: "zonos--finish-details" }, h("div", { key: '6bf32844fa9d38eae6e9f337e56b7918e49bf793', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'bf13e59b7bc2380609ffba879fa2b1d8c5d9a9e0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: 'c246affb94a9799e0c556affb73b2ebfb69a9c7f', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '61fa4fa0e09c0ce2905281b2696f42172c7a2bcd',
401
480
  // Only show loading spinner if it's not an error notification
402
481
  loading: this.isWaitingToRedirect &&
403
482
  this.notificationType !== 'error', onClick: () => {
@@ -409,9 +488,9 @@ export class ZonosCheckoutFinish {
409
488
  }
410
489
  this.closeClickHandler();
411
490
  }, size: "md", variant: "primary" }, translate('Close'))), !window.Zonos.isLegacyCheckout &&
412
- this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '9b809e21052fddb2149a2a1d0c22db4b10808403', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
491
+ this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '9227d7832ed477be556cb6d59c644a74c293c740', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
413
492
  cartStore.step === 'finish' &&
414
- this.notificationType === 'success' && (h("div", { key: '4a278c7c4270d265c61b6b36d20864c55e1b42f1', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'fd8a876a0c5b76edd3be2d9b28da9c3963aee714', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '7882981c1fe01ab6f78d8f84bcfc9aab94bffb74', onClick: () => {
493
+ this.notificationType === 'success' && (h("div", { key: '9107be1ef7895b0a5e3fe0a985036a11de7011d3', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'b0de8743bea8dd9ac7099bd5b77811f80d80a380', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'f90749b9af4c17eac554efb6d3d12cc41ac6e3c8', onClick: () => {
415
494
  const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
416
495
  this.redirectToUrl(isZonosDashboard
417
496
  ? '/orders/all'
@@ -2,6 +2,7 @@ import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore, cartStoreNextStep, } from "../../../store/checkout/cart";
3
3
  import { paypalStore } from "../../../store/checkout/paypal";
4
4
  import { stripeStore } from "../../../store/checkout/stripe";
5
+ import { storageStore } from "../../../store/storageStore";
5
6
  import { translate } from "../../../store/translationStore";
6
7
  import { zonosStore } from "../../../store/zonosStore";
7
8
  import { placeTestOrder } from "../../../utils/api/placeTestOrder";
@@ -50,7 +51,7 @@ export class ZonosCheckoutPayment {
50
51
  * handler for continue button click
51
52
  */
52
53
  this.continueClickHandler = async ({ currencyCode, }) => {
53
- var _a;
54
+ var _a, _b;
54
55
  if (!this.handleValidate()) {
55
56
  this.showErrorBanner = true;
56
57
  // Attempt to submit the form so the missing input error will be shown in Stripe
@@ -65,7 +66,13 @@ export class ZonosCheckoutPayment {
65
66
  }
66
67
  stripeStore.checkoutSettlementCurrency = currencyCode;
67
68
  // submit google tag when the form is complete
68
- submitGtag('zonos-checkout-payment-info');
69
+ submitGtag({
70
+ event: 'zonos-checkout-payment-info',
71
+ metadata: {
72
+ checkoutSessionId: storageStore.checkoutSessionId,
73
+ paymentMethod: (_b = stripeStore.stripePaymentEventData) === null || _b === void 0 ? void 0 : _b.value.type,
74
+ },
75
+ });
69
76
  this.continueClicked.emit();
70
77
  };
71
78
  this.copyCardToClipboard = async (cardNumber) => {
@@ -479,7 +479,12 @@ export class ZonosCheckout {
479
479
  }
480
480
  // Close the confirm dialog
481
481
  this.confirmDialogOpen = false;
482
- submitGtag('zonos-checkout-close');
482
+ submitGtag({
483
+ event: 'zonos-checkout-close',
484
+ metadata: {
485
+ checkoutSessionId: storageStore.checkoutSessionId,
486
+ },
487
+ });
483
488
  this.open = this.forceDialogOpen || false;
484
489
  if (!this.preview && cartStore.step === 'finish') {
485
490
  // reset cart store if it's not preview mode and only when checkout is in the finish step.
@@ -765,7 +770,12 @@ export class ZonosCheckout {
765
770
  isPreview: this.preview,
766
771
  sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
767
772
  });
768
- submitGtag('zonos-checkout-start');
773
+ submitGtag({
774
+ event: 'zonos-checkout-start',
775
+ metadata: {
776
+ checkoutSessionId: storageStore.checkoutSessionId,
777
+ },
778
+ });
769
779
  const checkoutSessionId = storageStore.checkoutSessionId;
770
780
  void trackConversionEvent({
771
781
  checkoutSessionId,
@@ -1086,7 +1096,12 @@ export class ZonosCheckout {
1086
1096
  async handleCustomerInfoContinue() {
1087
1097
  var _a, _b, _c, _d;
1088
1098
  // submit google tag when the form is complete
1089
- submitGtag('zonos-checkout-customer-info');
1099
+ submitGtag({
1100
+ event: 'zonos-checkout-customer-info',
1101
+ metadata: {
1102
+ checkoutSessionId: storageStore.checkoutSessionId,
1103
+ },
1104
+ });
1090
1105
  const checkoutSessionId = storageStore.checkoutSessionId;
1091
1106
  void trackConversionEvent({
1092
1107
  checkoutSessionId,
@@ -1225,7 +1240,12 @@ export class ZonosCheckout {
1225
1240
  }
1226
1241
  catch (err) {
1227
1242
  logError(err);
1228
- submitGtag('zonos-checkout-payment-fail');
1243
+ submitGtag({
1244
+ event: 'zonos-checkout-payment-fail',
1245
+ metadata: {
1246
+ checkoutSessionId: storageStore.checkoutSessionId,
1247
+ },
1248
+ });
1229
1249
  stripeStore.hasPaymentError = true;
1230
1250
  // should request inventory refund if there's an error during payment
1231
1251
  if (stripeStore.shouldInventoryRefund) {
@@ -74,20 +74,26 @@ export class ZonosShipping {
74
74
  * handler for continue button click
75
75
  */
76
76
  this.continueClickHandler = () => {
77
- var _a;
77
+ var _a, _b;
78
78
  // show error banner if the form is not complete
79
79
  if (!this.handleValidate()) {
80
80
  this.showErrorBanner = true;
81
81
  return;
82
82
  }
83
83
  // submit google tag when the form is complete
84
- submitGtag('zonos-checkout-shipping-info');
84
+ submitGtag({
85
+ event: 'zonos-checkout-shipping-info',
86
+ metadata: {
87
+ checkoutSessionId: storageStore.checkoutSessionId,
88
+ serviceLevelId: (_a = this.selectedShippingMethod) === null || _a === void 0 ? void 0 : _a.value,
89
+ },
90
+ });
85
91
  const checkoutSessionId = storageStore.checkoutSessionId;
86
92
  void trackConversionEvent({
87
93
  checkoutSessionId,
88
94
  eventName: 'checkout_shippingInfoCompleted',
89
95
  metadata: {
90
- serviceLevelId: (_a = this.selectedShippingMethod) === null || _a === void 0 ? void 0 : _a.value,
96
+ serviceLevelId: (_b = this.selectedShippingMethod) === null || _b === void 0 ? void 0 : _b.value,
91
97
  },
92
98
  });
93
99
  this.showErrorBanner = false;