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

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 (135) hide show
  1. package/CHANGELOG.md +251 -4
  2. package/README.md +89 -111
  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/package.json +12 -1
  134. package/dist/types-CTpRvFKZ.d.ts +0 -71
  135. package/dist/types-DGlBdsAy.d.mts +0 -71
@@ -192,7 +192,10 @@ code { font-size: 0.85em; }
192
192
  const cartMirror = {};
193
193
 
194
194
  function addToCartDetectorConfig() {
195
- return { enabled: false };
195
+ return {
196
+ enabled: false,
197
+ sources: []
198
+ };
196
199
  }
197
200
 
198
201
  function buildConfig() {
@@ -211,6 +214,70 @@ code { font-size: 0.85em; }
211
214
  timeoutMs: 10000,
212
215
  },
213
216
  identity: { ...base.identity, pixelId: PIXEL_ID },
217
+ commerce: {
218
+ enabled: true,
219
+ currency: 'BRL',
220
+ catalog: { products: [
221
+ {
222
+ id: 'main_offer',
223
+ name: 'Oferta Principal',
224
+ type: 'main',
225
+ price: 197,
226
+ currency: 'BRL',
227
+ quantity: 1,
228
+ },
229
+ {
230
+ id: 'order_bump_01',
231
+ name: 'Order Bump Especial',
232
+ type: 'order_bump',
233
+ price: 47,
234
+ currency: 'BRL',
235
+ quantity: 1,
236
+ },
237
+ {
238
+ id: 'upsell_01',
239
+ name: 'Upsell 01',
240
+ type: 'upsell',
241
+ price: 97,
242
+ currency: 'BRL',
243
+ quantity: 1,
244
+ },
245
+ ] },
246
+ cart: {
247
+ mode: 'single_product',
248
+ initialItems: [{ productId: "main_offer", quantity: 1 }],
249
+ calculateValueFrom: 'cart',
250
+ allowDynamicItems: true,
251
+ },
252
+ mappings: {
253
+ attributes: {
254
+ productId: ['data-product-id', 'data-sku', 'data-offer-id'],
255
+ productName: ['data-product-name', 'data-name'],
256
+ price: ['data-product-price', 'data-price'],
257
+ quantity: ['data-quantity', 'data-qty'],
258
+ currency: ['data-currency'],
259
+ },
260
+ fields: {
261
+ productId: ['productId', 'product_id', 'offerId', 'sku'],
262
+ productName: ['productName', 'product_name'],
263
+ price: ['price', 'amount'],
264
+ quantity: ['quantity', 'qty'],
265
+ currency: ['currency'],
266
+ email: ['email', 'customerEmail'],
267
+ phone: ['phone', 'telefone', 'customerPhone'],
268
+ },
269
+ },
270
+ enrichment: {
271
+ pageView: { enabled: false, source: 'cart' },
272
+ viewContent: { enabled: true, source: 'event_or_cart' },
273
+ lead: { enabled: false, source: 'event_or_cart' },
274
+ addToCart: { enabled: true, source: 'event_or_cart' },
275
+ removeFromCart: { enabled: true, source: 'event_or_cart' },
276
+ initiateCheckout: { enabled: true, source: 'cart' },
277
+ addPaymentInfo: { enabled: true, source: 'cart' },
278
+ purchase: { enabled: true, source: 'cart' },
279
+ }
280
+ },
214
281
  modules: {
215
282
  ...base.modules,
216
283
  core: {
@@ -272,81 +339,28 @@ code { font-size: 0.85em; }
272
339
  integrations: { ...base.modules.integrations, enabled: false },
273
340
  conversion: {
274
341
  enabled: true,
275
- commerce: {
276
- currency: 'BRL',
277
- catalog: { products: [
278
- {
279
- id: 'main_offer',
280
- name: 'Oferta Principal',
281
- type: 'main',
282
- price: 197,
283
- currency: 'BRL',
284
- quantity: 1,
285
- },
286
- {
287
- id: 'order_bump_01',
288
- name: 'Order Bump Especial',
289
- type: 'order_bump',
290
- price: 47,
291
- currency: 'BRL',
292
- quantity: 1,
293
- },
294
- {
295
- id: 'upsell_01',
296
- name: 'Upsell 01',
297
- type: 'upsell',
298
- price: 97,
299
- currency: 'BRL',
300
- quantity: 1,
301
- },
302
- ] },
303
- checkout: {
304
- mode: 'single_product',
305
- selectedItems: [{ productId: "main_offer", quantity: 1 }],
306
- calculateValueFrom: 'selected_items',
307
- allowDynamicItems: true,
308
- },
309
- mappings: {
310
- attributes: {
311
- productId: ['data-product-id', 'data-sku', 'data-offer-id'],
312
- productName: ['data-product-name', 'data-name'],
313
- price: ['data-product-price', 'data-price'],
314
- quantity: ['data-quantity', 'data-qty'],
315
- currency: ['data-currency'],
316
- },
317
- fields: {
318
- productId: ['productId', 'product_id', 'offerId', 'sku'],
319
- productName: ['productName', 'product_name'],
320
- price: ['price', 'amount'],
321
- quantity: ['quantity', 'qty'],
322
- currency: ['currency'],
323
- email: ['email', 'customerEmail'],
324
- phone: ['phone', 'telefone', 'customerPhone'],
325
- },
326
- },
327
- },
328
342
  manual: {
329
343
  pageView: { enabled: false },
330
- purchase: { enabled: false },
331
- lead: { enabled: false },
344
+ purchase: { enabled: false, sources: [] },
345
+ lead: { enabled: false, sources: [] },
332
346
  addToCart: { enabled: true },
333
347
  removeFromCart: { enabled: true },
334
- initiateCheckout: { enabled: false },
335
- addPaymentInfo: { enabled: false },
336
- search: { enabled: false },
337
- viewContent: { enabled: false },
348
+ initiateCheckout: { enabled: false, sources: [] },
349
+ addPaymentInfo: { enabled: false, sources: [] },
350
+ search: { enabled: false, sources: [] },
351
+ viewContent: { enabled: false, sources: [] },
338
352
  },
339
353
  auto: {
340
354
  enabled: true,
341
355
  detectors: {
342
- lead: { enabled: false },
343
- purchase: { enabled: false },
356
+ lead: { enabled: false, sources: [] },
357
+ purchase: { enabled: false, sources: [] },
344
358
  addToCart: addToCartDetectorConfig(),
345
- removeFromCart: { enabled: false },
346
- initiateCheckout: { enabled: false },
347
- addPaymentInfo: { enabled: false },
348
- search: { enabled: false },
349
- viewContent: { enabled: false },
359
+ removeFromCart: { enabled: false, sources: [] },
360
+ initiateCheckout: { enabled: false, sources: [] },
361
+ addPaymentInfo: { enabled: false, sources: [] },
362
+ search: { enabled: false, sources: [] },
363
+ viewContent: { enabled: false, sources: [] },
350
364
  },
351
365
  },
352
366
  rules: {
@@ -215,10 +215,19 @@ code { font-size: 0.85em; }
215
215
 
216
216
  function addToCartDetectorConfig() {
217
217
  return {
218
- enabled: true,
219
- selector: ['[data-track="add_to_cart"]'],
220
- selectorType: 'css',
221
- };
218
+ enabled: true,
219
+ sources: [
220
+ {
221
+ name: 'addToCart-selector',
222
+ type: 'selector',
223
+ selector: [
224
+ '[data-track=\'add_to_cart\']'
225
+ ],
226
+ selectorType: 'css',
227
+ trigger: 'click'
228
+ }
229
+ ]
230
+ };
222
231
  }
223
232
 
224
233
  function buildConfig() {
@@ -237,6 +246,70 @@ code { font-size: 0.85em; }
237
246
  timeoutMs: 10000,
238
247
  },
239
248
  identity: { ...base.identity, pixelId: PIXEL_ID },
249
+ commerce: {
250
+ enabled: true,
251
+ currency: 'BRL',
252
+ catalog: { products: [
253
+ {
254
+ id: 'main_offer',
255
+ name: 'Oferta Principal',
256
+ type: 'main',
257
+ price: 197,
258
+ currency: 'BRL',
259
+ quantity: 1,
260
+ },
261
+ {
262
+ id: 'order_bump_01',
263
+ name: 'Order Bump Especial',
264
+ type: 'order_bump',
265
+ price: 47,
266
+ currency: 'BRL',
267
+ quantity: 1,
268
+ },
269
+ {
270
+ id: 'upsell_01',
271
+ name: 'Upsell 01',
272
+ type: 'upsell',
273
+ price: 97,
274
+ currency: 'BRL',
275
+ quantity: 1,
276
+ },
277
+ ] },
278
+ cart: {
279
+ mode: 'single_product',
280
+ initialItems: [],
281
+ calculateValueFrom: 'cart',
282
+ allowDynamicItems: true,
283
+ },
284
+ mappings: {
285
+ attributes: {
286
+ productId: ['data-product-id', 'data-sku', 'data-offer-id'],
287
+ productName: ['data-product-name', 'data-name'],
288
+ price: ['data-product-price', 'data-price'],
289
+ quantity: ['data-quantity', 'data-qty'],
290
+ currency: ['data-currency'],
291
+ },
292
+ fields: {
293
+ productId: ['productId', 'product_id', 'offerId', 'sku'],
294
+ productName: ['productName', 'product_name'],
295
+ price: ['price', 'amount'],
296
+ quantity: ['quantity', 'qty'],
297
+ currency: ['currency'],
298
+ email: ['email', 'customerEmail'],
299
+ phone: ['phone', 'telefone', 'customerPhone'],
300
+ },
301
+ },
302
+ enrichment: {
303
+ pageView: { enabled: false, source: 'cart' },
304
+ viewContent: { enabled: true, source: 'event_or_cart' },
305
+ lead: { enabled: false, source: 'event_or_cart' },
306
+ addToCart: { enabled: true, source: 'event_or_cart' },
307
+ removeFromCart: { enabled: true, source: 'event_or_cart' },
308
+ initiateCheckout: { enabled: true, source: 'cart' },
309
+ addPaymentInfo: { enabled: true, source: 'cart' },
310
+ purchase: { enabled: true, source: 'cart' },
311
+ }
312
+ },
240
313
  modules: {
241
314
  ...base.modules,
242
315
  core: {
@@ -298,81 +371,28 @@ code { font-size: 0.85em; }
298
371
  integrations: { ...base.modules.integrations, enabled: false },
299
372
  conversion: {
300
373
  enabled: true,
301
- commerce: {
302
- currency: 'BRL',
303
- catalog: { products: [
304
- {
305
- id: 'main_offer',
306
- name: 'Oferta Principal',
307
- type: 'main',
308
- price: 197,
309
- currency: 'BRL',
310
- quantity: 1,
311
- },
312
- {
313
- id: 'order_bump_01',
314
- name: 'Order Bump Especial',
315
- type: 'order_bump',
316
- price: 47,
317
- currency: 'BRL',
318
- quantity: 1,
319
- },
320
- {
321
- id: 'upsell_01',
322
- name: 'Upsell 01',
323
- type: 'upsell',
324
- price: 97,
325
- currency: 'BRL',
326
- quantity: 1,
327
- },
328
- ] },
329
- checkout: {
330
- mode: 'single_product',
331
- selectedItems: [],
332
- calculateValueFrom: 'selected_items',
333
- allowDynamicItems: true,
334
- },
335
- mappings: {
336
- attributes: {
337
- productId: ['data-product-id', 'data-sku', 'data-offer-id'],
338
- productName: ['data-product-name', 'data-name'],
339
- price: ['data-product-price', 'data-price'],
340
- quantity: ['data-quantity', 'data-qty'],
341
- currency: ['data-currency'],
342
- },
343
- fields: {
344
- productId: ['productId', 'product_id', 'offerId', 'sku'],
345
- productName: ['productName', 'product_name'],
346
- price: ['price', 'amount'],
347
- quantity: ['quantity', 'qty'],
348
- currency: ['currency'],
349
- email: ['email', 'customerEmail'],
350
- phone: ['phone', 'telefone', 'customerPhone'],
351
- },
352
- },
353
- },
354
374
  manual: {
355
375
  pageView: { enabled: false },
356
- purchase: { enabled: false },
357
- lead: { enabled: false },
376
+ purchase: { enabled: false, sources: [] },
377
+ lead: { enabled: false, sources: [] },
358
378
  addToCart: { enabled: true },
359
379
  removeFromCart: { enabled: true },
360
- initiateCheckout: { enabled: false },
361
- addPaymentInfo: { enabled: false },
362
- search: { enabled: false },
363
- viewContent: { enabled: false },
380
+ initiateCheckout: { enabled: false, sources: [] },
381
+ addPaymentInfo: { enabled: false, sources: [] },
382
+ search: { enabled: false, sources: [] },
383
+ viewContent: { enabled: false, sources: [] },
364
384
  },
365
385
  auto: {
366
386
  enabled: true,
367
387
  detectors: {
368
- lead: { enabled: false },
369
- purchase: { enabled: false },
388
+ lead: { enabled: false, sources: [] },
389
+ purchase: { enabled: false, sources: [] },
370
390
  addToCart: addToCartDetectorConfig(),
371
- removeFromCart: { enabled: false },
372
- initiateCheckout: { enabled: false },
373
- addPaymentInfo: { enabled: false },
374
- search: { enabled: false },
375
- viewContent: { enabled: false },
391
+ removeFromCart: { enabled: false, sources: [] },
392
+ initiateCheckout: { enabled: false, sources: [] },
393
+ addPaymentInfo: { enabled: false, sources: [] },
394
+ search: { enabled: false, sources: [] },
395
+ viewContent: { enabled: false, sources: [] },
376
396
  },
377
397
  },
378
398
  rules: {
@@ -204,21 +204,33 @@ code { font-size: 0.85em; }
204
204
 
205
205
  function addToCartDetectorConfig() {
206
206
  return {
207
- enabled: true,
208
- selector: [
209
- 'text:Comprar agora',
210
- { type: 'text', value: 'Comprar agora' },
211
- ],
212
- selectorType: 'css',
213
- selectorForm: {
214
- fields: ['email', 'phone'],
215
- mode: 'all',
216
- formSelector: '#buy-now-form',
217
- trigger: 'click',
218
- debounceMs: 0,
219
- fireOnce: false,
220
- },
221
- };
207
+ enabled: true,
208
+ sources: [
209
+ {
210
+ name: 'addToCart-form',
211
+ type: 'form',
212
+ selectorForm: {
213
+ fields: [
214
+ 'email',
215
+ 'phone'
216
+ ],
217
+ mode: 'all',
218
+ formSelector: '#buy-now-form',
219
+ trigger: 'click',
220
+ debounceMs: 0,
221
+ fireOnce: false
222
+ },
223
+ selector: [
224
+ 'text:Comprar agora',
225
+ {
226
+ type: 'text',
227
+ value: 'Comprar agora'
228
+ }
229
+ ],
230
+ selectorType: 'css'
231
+ }
232
+ ]
233
+ };
222
234
  }
223
235
 
224
236
  function buildConfig() {
@@ -237,6 +249,70 @@ code { font-size: 0.85em; }
237
249
  timeoutMs: 10000,
238
250
  },
239
251
  identity: { ...base.identity, pixelId: PIXEL_ID },
252
+ commerce: {
253
+ enabled: true,
254
+ currency: 'BRL',
255
+ catalog: { products: [
256
+ {
257
+ id: 'main_offer',
258
+ name: 'Oferta Principal',
259
+ type: 'main',
260
+ price: 197,
261
+ currency: 'BRL',
262
+ quantity: 1,
263
+ },
264
+ {
265
+ id: 'order_bump_01',
266
+ name: 'Order Bump Especial',
267
+ type: 'order_bump',
268
+ price: 47,
269
+ currency: 'BRL',
270
+ quantity: 1,
271
+ },
272
+ {
273
+ id: 'upsell_01',
274
+ name: 'Upsell 01',
275
+ type: 'upsell',
276
+ price: 97,
277
+ currency: 'BRL',
278
+ quantity: 1,
279
+ },
280
+ ] },
281
+ cart: {
282
+ mode: 'single_product',
283
+ initialItems: [],
284
+ calculateValueFrom: 'cart',
285
+ allowDynamicItems: true,
286
+ },
287
+ mappings: {
288
+ attributes: {
289
+ productId: ['data-product-id', 'data-sku', 'data-offer-id'],
290
+ productName: ['data-product-name', 'data-name'],
291
+ price: ['data-product-price', 'data-price'],
292
+ quantity: ['data-quantity', 'data-qty'],
293
+ currency: ['data-currency'],
294
+ },
295
+ fields: {
296
+ productId: ['productId', 'product_id', 'offerId', 'sku'],
297
+ productName: ['productName', 'product_name'],
298
+ price: ['price', 'amount'],
299
+ quantity: ['quantity', 'qty'],
300
+ currency: ['currency'],
301
+ email: ['email', 'customerEmail'],
302
+ phone: ['phone', 'telefone', 'customerPhone'],
303
+ },
304
+ },
305
+ enrichment: {
306
+ pageView: { enabled: false, source: 'cart' },
307
+ viewContent: { enabled: true, source: 'event_or_cart' },
308
+ lead: { enabled: false, source: 'event_or_cart' },
309
+ addToCart: { enabled: true, source: 'event_or_cart' },
310
+ removeFromCart: { enabled: true, source: 'event_or_cart' },
311
+ initiateCheckout: { enabled: true, source: 'cart' },
312
+ addPaymentInfo: { enabled: true, source: 'cart' },
313
+ purchase: { enabled: true, source: 'cart' },
314
+ }
315
+ },
240
316
  modules: {
241
317
  ...base.modules,
242
318
  core: {
@@ -298,81 +374,28 @@ code { font-size: 0.85em; }
298
374
  integrations: { ...base.modules.integrations, enabled: false },
299
375
  conversion: {
300
376
  enabled: true,
301
- commerce: {
302
- currency: 'BRL',
303
- catalog: { products: [
304
- {
305
- id: 'main_offer',
306
- name: 'Oferta Principal',
307
- type: 'main',
308
- price: 197,
309
- currency: 'BRL',
310
- quantity: 1,
311
- },
312
- {
313
- id: 'order_bump_01',
314
- name: 'Order Bump Especial',
315
- type: 'order_bump',
316
- price: 47,
317
- currency: 'BRL',
318
- quantity: 1,
319
- },
320
- {
321
- id: 'upsell_01',
322
- name: 'Upsell 01',
323
- type: 'upsell',
324
- price: 97,
325
- currency: 'BRL',
326
- quantity: 1,
327
- },
328
- ] },
329
- checkout: {
330
- mode: 'single_product',
331
- selectedItems: [],
332
- calculateValueFrom: 'selected_items',
333
- allowDynamicItems: true,
334
- },
335
- mappings: {
336
- attributes: {
337
- productId: ['data-product-id', 'data-sku', 'data-offer-id'],
338
- productName: ['data-product-name', 'data-name'],
339
- price: ['data-product-price', 'data-price'],
340
- quantity: ['data-quantity', 'data-qty'],
341
- currency: ['data-currency'],
342
- },
343
- fields: {
344
- productId: ['productId', 'product_id', 'offerId', 'sku'],
345
- productName: ['productName', 'product_name'],
346
- price: ['price', 'amount'],
347
- quantity: ['quantity', 'qty'],
348
- currency: ['currency'],
349
- email: ['email', 'customerEmail'],
350
- phone: ['phone', 'telefone', 'customerPhone'],
351
- },
352
- },
353
- },
354
377
  manual: {
355
378
  pageView: { enabled: false },
356
- purchase: { enabled: false },
357
- lead: { enabled: false },
379
+ purchase: { enabled: false, sources: [] },
380
+ lead: { enabled: false, sources: [] },
358
381
  addToCart: { enabled: true },
359
382
  removeFromCart: { enabled: true },
360
- initiateCheckout: { enabled: false },
361
- addPaymentInfo: { enabled: false },
362
- search: { enabled: false },
363
- viewContent: { enabled: false },
383
+ initiateCheckout: { enabled: false, sources: [] },
384
+ addPaymentInfo: { enabled: false, sources: [] },
385
+ search: { enabled: false, sources: [] },
386
+ viewContent: { enabled: false, sources: [] },
364
387
  },
365
388
  auto: {
366
389
  enabled: true,
367
390
  detectors: {
368
- lead: { enabled: false },
369
- purchase: { enabled: false },
391
+ lead: { enabled: false, sources: [] },
392
+ purchase: { enabled: false, sources: [] },
370
393
  addToCart: addToCartDetectorConfig(),
371
- removeFromCart: { enabled: false },
372
- initiateCheckout: { enabled: false },
373
- addPaymentInfo: { enabled: false },
374
- search: { enabled: false },
375
- viewContent: { enabled: false },
394
+ removeFromCart: { enabled: false, sources: [] },
395
+ initiateCheckout: { enabled: false, sources: [] },
396
+ addPaymentInfo: { enabled: false, sources: [] },
397
+ search: { enabled: false, sources: [] },
398
+ viewContent: { enabled: false, sources: [] },
376
399
  },
377
400
  },
378
401
  rules: {