@beworke/pixel 0.1.0-rc.1 → 0.1.0-rc.6

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 (156) hide show
  1. package/CHANGELOG.md +260 -4
  2. package/README.md +65 -118
  3. package/RELEASE_CANDIDATE.md +181 -36
  4. package/dist/{StorageFactory-BhpbB6Jj.d.mts → StorageFactory-CPghDPBj.d.mts} +2 -2
  5. package/dist/{StorageFactory-CAkJJqVD.d.ts → StorageFactory-tjfzk57c.d.ts} +2 -2
  6. package/dist/config/index.cjs.js +1 -1
  7. package/dist/config/index.cjs.js.map +1 -1
  8. package/dist/config/index.d.mts +4 -3
  9. package/dist/config/index.d.ts +4 -3
  10. package/dist/config/index.esm.js +1 -1
  11. package/dist/config/index.esm.js.map +1 -1
  12. package/dist/events/index.cjs.js +1 -1
  13. package/dist/events/index.cjs.js.map +1 -1
  14. package/dist/events/index.d.mts +2 -1
  15. package/dist/events/index.d.ts +2 -1
  16. package/dist/events/index.esm.js +1 -1
  17. package/dist/events/index.esm.js.map +1 -1
  18. package/dist/examples/html-script/README.md +24 -2
  19. package/dist/examples/html-script/RELEASE_CANDIDATE.md +20 -6
  20. package/dist/examples/html-script/add-payment-info/README.md +3 -3
  21. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +66 -48
  22. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +66 -48
  23. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +65 -47
  24. package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +73 -47
  25. package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +65 -47
  26. package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +56 -47
  27. package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +65 -47
  28. package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +65 -47
  29. package/dist/examples/html-script/add-to-cart/README.md +3 -3
  30. package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +90 -70
  31. package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +103 -81
  32. package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +101 -78
  33. package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +90 -70
  34. package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +81 -67
  35. package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +90 -70
  36. package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +104 -81
  37. package/dist/examples/html-script/behavior/example-behavior-engagement.html +489 -0
  38. package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +350 -0
  39. package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +433 -0
  40. package/dist/examples/html-script/behavior/example-behavior-viewport.html +397 -0
  41. package/dist/examples/html-script/{example-behavior.html → behavior/example-behavior.html} +23 -17
  42. package/dist/examples/html-script/example-checkout-commerce.html +825 -0
  43. package/dist/examples/html-script/example-integration.html +5 -5
  44. package/dist/examples/html-script/example-landing-commerce.html +380 -0
  45. package/dist/examples/html-script/example-runtime-diagnostics.html +108 -0
  46. package/dist/examples/html-script/example-transport.html +5 -5
  47. package/dist/examples/html-script/full-funnel/README.md +64 -0
  48. package/dist/examples/html-script/full-funnel/checkout.html +116 -0
  49. package/dist/examples/html-script/full-funnel/downsell.html +58 -0
  50. package/dist/examples/html-script/full-funnel/landing.html +99 -0
  51. package/dist/examples/html-script/full-funnel/thank-you.html +85 -0
  52. package/dist/examples/html-script/full-funnel/upsell.html +64 -0
  53. package/dist/examples/html-script/initiate-checkout/README.md +6 -6
  54. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +94 -74
  55. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +102 -80
  56. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +103 -80
  57. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +86 -72
  58. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +95 -75
  59. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +103 -83
  60. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +105 -82
  61. package/dist/examples/html-script/lead/README.md +9 -7
  62. package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +67 -47
  63. package/dist/examples/html-script/lead/example-lead-trigger-auto.html +78 -56
  64. package/dist/examples/html-script/lead/example-lead-trigger-click.html +78 -55
  65. package/dist/examples/html-script/release-candidate.html +187 -76
  66. package/dist/examples/html-script/remove-from-cart/README.md +1 -1
  67. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +93 -73
  68. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +93 -73
  69. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +93 -73
  70. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +84 -70
  71. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +94 -74
  72. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +95 -75
  73. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +98 -76
  74. package/dist/examples/html-script/search/README.md +1 -1
  75. package/dist/examples/html-script/search/example-search-attribute.html +66 -51
  76. package/dist/examples/html-script/search/example-search-button-sync.html +66 -51
  77. package/dist/examples/html-script/search/example-search-dedupe.html +66 -51
  78. package/dist/examples/html-script/search/example-search-input.html +67 -51
  79. package/dist/examples/html-script/search/example-search-manual.html +57 -48
  80. package/dist/examples/html-script/search/example-search-submit.html +66 -51
  81. package/dist/examples/html-script/search/example-search-text.html +71 -51
  82. package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +63 -0
  83. package/dist/examples/html-script/url-context/example-url-context-landing.html +70 -0
  84. package/dist/examples/html-script/url-context/example-url-context-upsell.html +67 -0
  85. package/dist/examples/html-script/url-context/example-url-context.html +171 -0
  86. package/dist/examples/html-script/view-content/README.md +1 -1
  87. package/dist/examples/html-script/view-content/example-view-content-attribute.html +85 -70
  88. package/dist/examples/html-script/view-content/example-view-content-css.html +85 -70
  89. package/dist/examples/html-script/view-content/example-view-content-dedupe.html +85 -70
  90. package/dist/examples/html-script/view-content/example-view-content-empty.html +85 -70
  91. package/dist/examples/html-script/view-content/example-view-content-manual.html +76 -67
  92. package/dist/examples/html-script/view-content/example-view-content-product-card.html +85 -70
  93. package/dist/examples/html-script/view-content/example-view-content-text.html +90 -73
  94. package/dist/examples/v2/README.md +4 -1
  95. package/dist/{index-DUfFzniE.d.ts → index-CQAyT5Od.d.ts} +170 -3
  96. package/dist/{index-DUfFzniE.d.mts → index-JlKPz4pp.d.mts} +170 -3
  97. package/dist/index.cjs.js +1 -1
  98. package/dist/index.cjs.js.map +1 -1
  99. package/dist/index.d.mts +435 -12
  100. package/dist/index.d.ts +435 -12
  101. package/dist/index.esm.js +1 -1
  102. package/dist/index.esm.js.map +1 -1
  103. package/dist/{pixel-CbeF25mD.d.mts → pixel-BxZZx8l5.d.ts} +248 -72
  104. package/dist/{pixel-CbeF25mD.d.ts → pixel-CKc4OQUx.d.mts} +248 -72
  105. package/dist/{pixel-default-config-1VgLFOiL.d.mts → pixel-default-config-CJl-eypl.d.mts} +1 -1
  106. package/dist/{pixel-default-config-Bxb-Vdd8.d.ts → pixel-default-config-aAOujzwp.d.ts} +1 -1
  107. package/dist/runtime/index.cjs.js +1 -1
  108. package/dist/runtime/index.cjs.js.map +1 -1
  109. package/dist/runtime/index.d.mts +19 -26
  110. package/dist/runtime/index.d.ts +19 -26
  111. package/dist/runtime/index.esm.js +1 -1
  112. package/dist/runtime/index.esm.js.map +1 -1
  113. package/dist/services/index.cjs.js +1 -1
  114. package/dist/services/index.cjs.js.map +1 -1
  115. package/dist/services/index.d.mts +14 -6
  116. package/dist/services/index.d.ts +14 -6
  117. package/dist/services/index.esm.js +1 -1
  118. package/dist/services/index.esm.js.map +1 -1
  119. package/dist/types-BP8dz1gP.d.mts +19 -0
  120. package/dist/types-C75pQP31.d.ts +19 -0
  121. package/dist/types-DMhzHSVC.d.mts +293 -0
  122. package/dist/types-D_SsCur9.d.ts +293 -0
  123. package/dist/url-context-BjAsQoVl.d.mts +85 -0
  124. package/dist/url-context-BjAsQoVl.d.ts +85 -0
  125. package/dist/v2/global.global.js +1 -1
  126. package/dist/v2/global.global.js.map +1 -1
  127. package/dist/v2/index.cjs.js +1 -1
  128. package/dist/v2/index.cjs.js.map +1 -1
  129. package/dist/v2/index.d.mts +8 -6
  130. package/dist/v2/index.d.ts +8 -6
  131. package/dist/v2/index.esm.js +1 -1
  132. package/dist/v2/index.esm.js.map +1 -1
  133. package/docs/public/README.md +75 -0
  134. package/docs/public/api/exports.md +47 -0
  135. package/docs/public/api/pixel.md +65 -0
  136. package/docs/public/configuration/commerce.md +44 -0
  137. package/docs/public/configuration/modules.md +66 -0
  138. package/docs/public/configuration/overview.md +66 -0
  139. package/docs/public/events/catalog.md +65 -0
  140. package/docs/public/getting-started/installation.md +75 -0
  141. package/docs/public/getting-started/quick-start.md +77 -0
  142. package/docs/public/getting-started/react-nextjs.md +55 -0
  143. package/docs/public/getting-started/script-tag.md +57 -0
  144. package/docs/public/guides/funnel-checkout.md +52 -0
  145. package/docs/public/guides/funnel-downsell.md +53 -0
  146. package/docs/public/guides/funnel-full.md +64 -0
  147. package/docs/public/guides/funnel-landing.md +68 -0
  148. package/docs/public/guides/funnel-thank-you.md +48 -0
  149. package/docs/public/guides/funnel-upsell.md +72 -0
  150. package/docs/public/limitations.md +32 -0
  151. package/docs/public/privacy/limitations.md +33 -0
  152. package/docs/public/release-candidate/validation.md +37 -0
  153. package/docs/public/troubleshooting.md +55 -0
  154. package/package.json +13 -1
  155. package/dist/types-CTpRvFKZ.d.ts +0 -71
  156. package/dist/types-DGlBdsAy.d.mts +0 -71
@@ -195,10 +195,19 @@ code { font-size: 0.85em; }
195
195
 
196
196
  function removeFromCartDetectorConfig() {
197
197
  return {
198
- enabled: true,
199
- selector: ['.remove-from-cart'],
200
- selectorType: 'css',
201
- };
198
+ enabled: true,
199
+ sources: [
200
+ {
201
+ name: 'removeFromCart-selector',
202
+ type: 'selector',
203
+ selector: [
204
+ '.remove-from-cart'
205
+ ],
206
+ selectorType: 'css',
207
+ trigger: 'click'
208
+ }
209
+ ]
210
+ };
202
211
  }
203
212
 
204
213
  function buildConfig() {
@@ -217,6 +226,73 @@ code { font-size: 0.85em; }
217
226
  timeoutMs: 10000,
218
227
  },
219
228
  identity: { ...base.identity, pixelId: PIXEL_ID },
229
+ commerce: {
230
+ enabled: true,
231
+ currency: 'BRL',
232
+ catalog: { products: [
233
+ {
234
+ id: 'main_offer',
235
+ name: 'Oferta Principal',
236
+ type: 'main',
237
+ price: 197,
238
+ currency: 'BRL',
239
+ quantity: 1,
240
+ },
241
+ {
242
+ id: 'order_bump_01',
243
+ name: 'Order Bump Especial',
244
+ type: 'order_bump',
245
+ price: 47,
246
+ currency: 'BRL',
247
+ quantity: 1,
248
+ },
249
+ {
250
+ id: 'upsell_01',
251
+ name: 'Upsell 01',
252
+ type: 'upsell',
253
+ price: 97,
254
+ currency: 'BRL',
255
+ quantity: 1,
256
+ },
257
+ ] },
258
+ cart: {
259
+ mode: 'single_product',
260
+ initialItems: [
261
+ { productId: 'main_offer', quantity: 1 },
262
+ { productId: 'order_bump_01', quantity: 1 },
263
+ ],
264
+ calculateValueFrom: 'cart',
265
+ allowDynamicItems: true,
266
+ },
267
+ mappings: {
268
+ attributes: {
269
+ productId: ['data-product-id', 'data-sku', 'data-offer-id'],
270
+ productName: ['data-product-name', 'data-name'],
271
+ price: ['data-product-price', 'data-price'],
272
+ quantity: ['data-quantity', 'data-qty'],
273
+ currency: ['data-currency'],
274
+ },
275
+ fields: {
276
+ productId: ['productId', 'product_id', 'offerId', 'sku'],
277
+ productName: ['productName', 'product_name'],
278
+ price: ['price', 'amount'],
279
+ quantity: ['quantity', 'qty'],
280
+ currency: ['currency'],
281
+ email: ['email', 'customerEmail'],
282
+ phone: ['phone', 'telefone', 'customerPhone'],
283
+ },
284
+ },
285
+ enrichment: {
286
+ pageView: { enabled: false, source: 'cart' },
287
+ viewContent: { enabled: true, source: 'event_or_cart' },
288
+ lead: { enabled: false, source: 'event_or_cart' },
289
+ addToCart: { enabled: true, source: 'event_or_cart' },
290
+ removeFromCart: { enabled: true, source: 'event_or_cart' },
291
+ initiateCheckout: { enabled: true, source: 'cart' },
292
+ addPaymentInfo: { enabled: true, source: 'cart' },
293
+ purchase: { enabled: true, source: 'cart' },
294
+ }
295
+ },
220
296
  modules: {
221
297
  ...base.modules,
222
298
  core: {
@@ -278,84 +354,28 @@ code { font-size: 0.85em; }
278
354
  integrations: { ...base.modules.integrations, enabled: false },
279
355
  conversion: {
280
356
  enabled: true,
281
- commerce: {
282
- currency: 'BRL',
283
- catalog: { products: [
284
- {
285
- id: 'main_offer',
286
- name: 'Oferta Principal',
287
- type: 'main',
288
- price: 197,
289
- currency: 'BRL',
290
- quantity: 1,
291
- },
292
- {
293
- id: 'order_bump_01',
294
- name: 'Order Bump Especial',
295
- type: 'order_bump',
296
- price: 47,
297
- currency: 'BRL',
298
- quantity: 1,
299
- },
300
- {
301
- id: 'upsell_01',
302
- name: 'Upsell 01',
303
- type: 'upsell',
304
- price: 97,
305
- currency: 'BRL',
306
- quantity: 1,
307
- },
308
- ] },
309
- checkout: {
310
- mode: 'single_product',
311
- selectedItems: [
312
- { productId: 'main_offer', quantity: 1 },
313
- { productId: 'order_bump_01', quantity: 1 },
314
- ],
315
- calculateValueFrom: 'selected_items',
316
- allowDynamicItems: true,
317
- },
318
- mappings: {
319
- attributes: {
320
- productId: ['data-product-id', 'data-sku', 'data-offer-id'],
321
- productName: ['data-product-name', 'data-name'],
322
- price: ['data-product-price', 'data-price'],
323
- quantity: ['data-quantity', 'data-qty'],
324
- currency: ['data-currency'],
325
- },
326
- fields: {
327
- productId: ['productId', 'product_id', 'offerId', 'sku'],
328
- productName: ['productName', 'product_name'],
329
- price: ['price', 'amount'],
330
- quantity: ['quantity', 'qty'],
331
- currency: ['currency'],
332
- email: ['email', 'customerEmail'],
333
- phone: ['phone', 'telefone', 'customerPhone'],
334
- },
335
- },
336
- },
337
357
  manual: {
338
358
  pageView: { enabled: false },
339
- purchase: { enabled: false },
340
- lead: { enabled: false },
359
+ purchase: { enabled: false, sources: [] },
360
+ lead: { enabled: false, sources: [] },
341
361
  addToCart: { enabled: true },
342
362
  removeFromCart: { enabled: true },
343
- initiateCheckout: { enabled: false },
344
- addPaymentInfo: { enabled: false },
345
- search: { enabled: false },
346
- viewContent: { enabled: false },
363
+ initiateCheckout: { enabled: false, sources: [] },
364
+ addPaymentInfo: { enabled: false, sources: [] },
365
+ search: { enabled: false, sources: [] },
366
+ viewContent: { enabled: false, sources: [] },
347
367
  },
348
368
  auto: {
349
369
  enabled: true,
350
370
  detectors: {
351
- lead: { enabled: false },
352
- purchase: { enabled: false },
353
- addToCart: { enabled: false },
371
+ lead: { enabled: false, sources: [] },
372
+ purchase: { enabled: false, sources: [] },
373
+ addToCart: { enabled: false, sources: [] },
354
374
  removeFromCart: removeFromCartDetectorConfig(),
355
- initiateCheckout: { enabled: false },
356
- addPaymentInfo: { enabled: false },
357
- search: { enabled: false },
358
- viewContent: { enabled: false },
375
+ initiateCheckout: { enabled: false, sources: [] },
376
+ addPaymentInfo: { enabled: false, sources: [] },
377
+ search: { enabled: false, sources: [] },
378
+ viewContent: { enabled: false, sources: [] },
359
379
  },
360
380
  },
361
381
  rules: {
@@ -201,10 +201,19 @@ code { font-size: 0.85em; }
201
201
 
202
202
  function removeFromCartDetectorConfig() {
203
203
  return {
204
- enabled: true,
205
- selector: ['[data-track="remove_from_cart"]'],
206
- selectorType: 'css',
207
- };
204
+ enabled: true,
205
+ sources: [
206
+ {
207
+ name: 'removeFromCart-selector',
208
+ type: 'selector',
209
+ selector: [
210
+ '[data-track=\'remove_from_cart\']'
211
+ ],
212
+ selectorType: 'css',
213
+ trigger: 'click'
214
+ }
215
+ ]
216
+ };
208
217
  }
209
218
 
210
219
  function buildConfig() {
@@ -223,6 +232,73 @@ code { font-size: 0.85em; }
223
232
  timeoutMs: 10000,
224
233
  },
225
234
  identity: { ...base.identity, pixelId: PIXEL_ID },
235
+ commerce: {
236
+ enabled: true,
237
+ currency: 'BRL',
238
+ catalog: { products: [
239
+ {
240
+ id: 'main_offer',
241
+ name: 'Oferta Principal',
242
+ type: 'main',
243
+ price: 197,
244
+ currency: 'BRL',
245
+ quantity: 1,
246
+ },
247
+ {
248
+ id: 'order_bump_01',
249
+ name: 'Order Bump Especial',
250
+ type: 'order_bump',
251
+ price: 47,
252
+ currency: 'BRL',
253
+ quantity: 1,
254
+ },
255
+ {
256
+ id: 'upsell_01',
257
+ name: 'Upsell 01',
258
+ type: 'upsell',
259
+ price: 97,
260
+ currency: 'BRL',
261
+ quantity: 1,
262
+ },
263
+ ] },
264
+ cart: {
265
+ mode: 'single_product',
266
+ initialItems: [
267
+ { productId: 'main_offer', quantity: 1 },
268
+ { productId: 'order_bump_01', quantity: 1 },
269
+ ],
270
+ calculateValueFrom: 'cart',
271
+ allowDynamicItems: true,
272
+ },
273
+ mappings: {
274
+ attributes: {
275
+ productId: ['data-product-id', 'data-sku', 'data-offer-id'],
276
+ productName: ['data-product-name', 'data-name'],
277
+ price: ['data-product-price', 'data-price'],
278
+ quantity: ['data-quantity', 'data-qty'],
279
+ currency: ['data-currency'],
280
+ },
281
+ fields: {
282
+ productId: ['productId', 'product_id', 'offerId', 'sku'],
283
+ productName: ['productName', 'product_name'],
284
+ price: ['price', 'amount'],
285
+ quantity: ['quantity', 'qty'],
286
+ currency: ['currency'],
287
+ email: ['email', 'customerEmail'],
288
+ phone: ['phone', 'telefone', 'customerPhone'],
289
+ },
290
+ },
291
+ enrichment: {
292
+ pageView: { enabled: false, source: 'cart' },
293
+ viewContent: { enabled: true, source: 'event_or_cart' },
294
+ lead: { enabled: false, source: 'event_or_cart' },
295
+ addToCart: { enabled: true, source: 'event_or_cart' },
296
+ removeFromCart: { enabled: true, source: 'event_or_cart' },
297
+ initiateCheckout: { enabled: true, source: 'cart' },
298
+ addPaymentInfo: { enabled: true, source: 'cart' },
299
+ purchase: { enabled: true, source: 'cart' },
300
+ }
301
+ },
226
302
  modules: {
227
303
  ...base.modules,
228
304
  core: {
@@ -284,84 +360,28 @@ code { font-size: 0.85em; }
284
360
  integrations: { ...base.modules.integrations, enabled: false },
285
361
  conversion: {
286
362
  enabled: true,
287
- commerce: {
288
- currency: 'BRL',
289
- catalog: { products: [
290
- {
291
- id: 'main_offer',
292
- name: 'Oferta Principal',
293
- type: 'main',
294
- price: 197,
295
- currency: 'BRL',
296
- quantity: 1,
297
- },
298
- {
299
- id: 'order_bump_01',
300
- name: 'Order Bump Especial',
301
- type: 'order_bump',
302
- price: 47,
303
- currency: 'BRL',
304
- quantity: 1,
305
- },
306
- {
307
- id: 'upsell_01',
308
- name: 'Upsell 01',
309
- type: 'upsell',
310
- price: 97,
311
- currency: 'BRL',
312
- quantity: 1,
313
- },
314
- ] },
315
- checkout: {
316
- mode: 'single_product',
317
- selectedItems: [
318
- { productId: 'main_offer', quantity: 1 },
319
- { productId: 'order_bump_01', quantity: 1 },
320
- ],
321
- calculateValueFrom: 'selected_items',
322
- allowDynamicItems: true,
323
- },
324
- mappings: {
325
- attributes: {
326
- productId: ['data-product-id', 'data-sku', 'data-offer-id'],
327
- productName: ['data-product-name', 'data-name'],
328
- price: ['data-product-price', 'data-price'],
329
- quantity: ['data-quantity', 'data-qty'],
330
- currency: ['data-currency'],
331
- },
332
- fields: {
333
- productId: ['productId', 'product_id', 'offerId', 'sku'],
334
- productName: ['productName', 'product_name'],
335
- price: ['price', 'amount'],
336
- quantity: ['quantity', 'qty'],
337
- currency: ['currency'],
338
- email: ['email', 'customerEmail'],
339
- phone: ['phone', 'telefone', 'customerPhone'],
340
- },
341
- },
342
- },
343
363
  manual: {
344
364
  pageView: { enabled: false },
345
- purchase: { enabled: false },
346
- lead: { enabled: false },
365
+ purchase: { enabled: false, sources: [] },
366
+ lead: { enabled: false, sources: [] },
347
367
  addToCart: { enabled: true },
348
368
  removeFromCart: { enabled: true },
349
- initiateCheckout: { enabled: false },
350
- addPaymentInfo: { enabled: false },
351
- search: { enabled: false },
352
- viewContent: { enabled: false },
369
+ initiateCheckout: { enabled: false, sources: [] },
370
+ addPaymentInfo: { enabled: false, sources: [] },
371
+ search: { enabled: false, sources: [] },
372
+ viewContent: { enabled: false, sources: [] },
353
373
  },
354
374
  auto: {
355
375
  enabled: true,
356
376
  detectors: {
357
- lead: { enabled: false },
358
- purchase: { enabled: false },
359
- addToCart: { enabled: false },
377
+ lead: { enabled: false, sources: [] },
378
+ purchase: { enabled: false, sources: [] },
379
+ addToCart: { enabled: false, sources: [] },
360
380
  removeFromCart: removeFromCartDetectorConfig(),
361
- initiateCheckout: { enabled: false },
362
- addPaymentInfo: { enabled: false },
363
- search: { enabled: false },
364
- viewContent: { enabled: false },
381
+ initiateCheckout: { enabled: false, sources: [] },
382
+ addPaymentInfo: { enabled: false, sources: [] },
383
+ search: { enabled: false, sources: [] },
384
+ viewContent: { enabled: false, sources: [] },
365
385
  },
366
386
  },
367
387
  rules: {
@@ -193,7 +193,10 @@ code { font-size: 0.85em; }
193
193
  const cartMirror = {};
194
194
 
195
195
  function removeFromCartDetectorConfig() {
196
- return { enabled: false };
196
+ return {
197
+ enabled: false,
198
+ sources: []
199
+ };
197
200
  }
198
201
 
199
202
  function buildConfig() {
@@ -212,6 +215,73 @@ code { font-size: 0.85em; }
212
215
  timeoutMs: 10000,
213
216
  },
214
217
  identity: { ...base.identity, pixelId: PIXEL_ID },
218
+ commerce: {
219
+ enabled: true,
220
+ currency: 'BRL',
221
+ catalog: { products: [
222
+ {
223
+ id: 'main_offer',
224
+ name: 'Oferta Principal',
225
+ type: 'main',
226
+ price: 197,
227
+ currency: 'BRL',
228
+ quantity: 1,
229
+ },
230
+ {
231
+ id: 'order_bump_01',
232
+ name: 'Order Bump Especial',
233
+ type: 'order_bump',
234
+ price: 47,
235
+ currency: 'BRL',
236
+ quantity: 1,
237
+ },
238
+ {
239
+ id: 'upsell_01',
240
+ name: 'Upsell 01',
241
+ type: 'upsell',
242
+ price: 97,
243
+ currency: 'BRL',
244
+ quantity: 1,
245
+ },
246
+ ] },
247
+ cart: {
248
+ mode: 'single_product',
249
+ initialItems: [
250
+ { productId: 'main_offer', quantity: 1 },
251
+ { productId: 'order_bump_01', quantity: 1 },
252
+ ],
253
+ calculateValueFrom: 'cart',
254
+ allowDynamicItems: true,
255
+ },
256
+ mappings: {
257
+ attributes: {
258
+ productId: ['data-product-id', 'data-sku', 'data-offer-id'],
259
+ productName: ['data-product-name', 'data-name'],
260
+ price: ['data-product-price', 'data-price'],
261
+ quantity: ['data-quantity', 'data-qty'],
262
+ currency: ['data-currency'],
263
+ },
264
+ fields: {
265
+ productId: ['productId', 'product_id', 'offerId', 'sku'],
266
+ productName: ['productName', 'product_name'],
267
+ price: ['price', 'amount'],
268
+ quantity: ['quantity', 'qty'],
269
+ currency: ['currency'],
270
+ email: ['email', 'customerEmail'],
271
+ phone: ['phone', 'telefone', 'customerPhone'],
272
+ },
273
+ },
274
+ enrichment: {
275
+ pageView: { enabled: false, source: 'cart' },
276
+ viewContent: { enabled: true, source: 'event_or_cart' },
277
+ lead: { enabled: false, source: 'event_or_cart' },
278
+ addToCart: { enabled: true, source: 'event_or_cart' },
279
+ removeFromCart: { enabled: true, source: 'event_or_cart' },
280
+ initiateCheckout: { enabled: true, source: 'cart' },
281
+ addPaymentInfo: { enabled: true, source: 'cart' },
282
+ purchase: { enabled: true, source: 'cart' },
283
+ }
284
+ },
215
285
  modules: {
216
286
  ...base.modules,
217
287
  core: {
@@ -273,84 +343,28 @@ code { font-size: 0.85em; }
273
343
  integrations: { ...base.modules.integrations, enabled: false },
274
344
  conversion: {
275
345
  enabled: true,
276
- commerce: {
277
- currency: 'BRL',
278
- catalog: { products: [
279
- {
280
- id: 'main_offer',
281
- name: 'Oferta Principal',
282
- type: 'main',
283
- price: 197,
284
- currency: 'BRL',
285
- quantity: 1,
286
- },
287
- {
288
- id: 'order_bump_01',
289
- name: 'Order Bump Especial',
290
- type: 'order_bump',
291
- price: 47,
292
- currency: 'BRL',
293
- quantity: 1,
294
- },
295
- {
296
- id: 'upsell_01',
297
- name: 'Upsell 01',
298
- type: 'upsell',
299
- price: 97,
300
- currency: 'BRL',
301
- quantity: 1,
302
- },
303
- ] },
304
- checkout: {
305
- mode: 'single_product',
306
- selectedItems: [
307
- { productId: 'main_offer', quantity: 1 },
308
- { productId: 'order_bump_01', quantity: 1 },
309
- ],
310
- calculateValueFrom: 'selected_items',
311
- allowDynamicItems: true,
312
- },
313
- mappings: {
314
- attributes: {
315
- productId: ['data-product-id', 'data-sku', 'data-offer-id'],
316
- productName: ['data-product-name', 'data-name'],
317
- price: ['data-product-price', 'data-price'],
318
- quantity: ['data-quantity', 'data-qty'],
319
- currency: ['data-currency'],
320
- },
321
- fields: {
322
- productId: ['productId', 'product_id', 'offerId', 'sku'],
323
- productName: ['productName', 'product_name'],
324
- price: ['price', 'amount'],
325
- quantity: ['quantity', 'qty'],
326
- currency: ['currency'],
327
- email: ['email', 'customerEmail'],
328
- phone: ['phone', 'telefone', 'customerPhone'],
329
- },
330
- },
331
- },
332
346
  manual: {
333
347
  pageView: { enabled: false },
334
- purchase: { enabled: false },
335
- lead: { enabled: false },
348
+ purchase: { enabled: false, sources: [] },
349
+ lead: { enabled: false, sources: [] },
336
350
  addToCart: { enabled: true },
337
351
  removeFromCart: { enabled: true },
338
- initiateCheckout: { enabled: false },
339
- addPaymentInfo: { enabled: false },
340
- search: { enabled: false },
341
- viewContent: { enabled: false },
352
+ initiateCheckout: { enabled: false, sources: [] },
353
+ addPaymentInfo: { enabled: false, sources: [] },
354
+ search: { enabled: false, sources: [] },
355
+ viewContent: { enabled: false, sources: [] },
342
356
  },
343
357
  auto: {
344
358
  enabled: true,
345
359
  detectors: {
346
- lead: { enabled: false },
347
- purchase: { enabled: false },
348
- addToCart: { enabled: false },
360
+ lead: { enabled: false, sources: [] },
361
+ purchase: { enabled: false, sources: [] },
362
+ addToCart: { enabled: false, sources: [] },
349
363
  removeFromCart: removeFromCartDetectorConfig(),
350
- initiateCheckout: { enabled: false },
351
- addPaymentInfo: { enabled: false },
352
- search: { enabled: false },
353
- viewContent: { enabled: false },
364
+ initiateCheckout: { enabled: false, sources: [] },
365
+ addPaymentInfo: { enabled: false, sources: [] },
366
+ search: { enabled: false, sources: [] },
367
+ viewContent: { enabled: false, sources: [] },
354
368
  },
355
369
  },
356
370
  rules: {