@beworke/pixel 0.1.0-rc.1 → 0.1.0-rc.11
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.
- package/CHANGELOG.md +311 -4
- package/README.md +90 -128
- package/RELEASE_CANDIDATE.md +218 -101
- package/dist/Pixel-BnN86r4X.d.ts +797 -0
- package/dist/Pixel-BoUGqCbP.d.mts +797 -0
- package/dist/{StorageFactory-CAkJJqVD.d.ts → StorageFactory-BfCArzMM.d.ts} +2 -2
- package/dist/{StorageFactory-BhpbB6Jj.d.mts → StorageFactory-C0prtNR7.d.mts} +2 -2
- package/dist/browser/index.cjs.js +3 -0
- package/dist/browser/index.cjs.js.map +1 -0
- package/dist/browser/index.d.mts +77 -0
- package/dist/browser/index.d.ts +77 -0
- package/dist/browser/index.esm.js +3 -0
- package/dist/browser/index.esm.js.map +1 -0
- package/dist/browser/pixel.buygoods-checkout.global.js +4 -0
- package/dist/browser/pixel.buygoods-checkout.global.js.map +1 -0
- package/dist/browser/pixel.buygoods-landing.global.js +4 -0
- package/dist/browser/pixel.buygoods-landing.global.js.map +1 -0
- package/dist/browser/pixel.global.js +4 -0
- package/dist/browser/pixel.global.js.map +1 -0
- package/dist/browser/pixel.internal-checkout.global.js +4 -0
- package/dist/browser/pixel.internal-checkout.global.js.map +1 -0
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.mts +16 -5
- package/dist/config/index.d.ts +16 -5
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/events/index.cjs.js +1 -1
- package/dist/events/index.cjs.js.map +1 -1
- package/dist/events/index.d.mts +2 -1
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.esm.js +1 -1
- package/dist/events/index.esm.js.map +1 -1
- package/dist/examples/html-script/README.md +21 -55
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +39 -26
- package/dist/examples/html-script/add-payment-info/README.md +3 -3
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +107 -96
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +107 -96
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +106 -95
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +114 -95
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +106 -95
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +97 -95
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +106 -95
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +106 -95
- package/dist/examples/html-script/add-to-cart/README.md +9 -6
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +133 -119
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +146 -130
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +144 -127
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +133 -119
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +590 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +124 -116
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +133 -119
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +147 -130
- package/dist/examples/html-script/behavior/example-behavior-engagement.html +489 -0
- package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +350 -0
- package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +433 -0
- package/dist/examples/html-script/behavior/example-behavior-viewport.html +397 -0
- package/dist/examples/html-script/{example-behavior.html → behavior/example-behavior.html} +23 -17
- package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +50 -0
- package/dist/examples/html-script/buygoods/ladding.html +184 -0
- package/dist/examples/html-script/example-basic.html +1 -1
- package/dist/examples/html-script/example-checkout-commerce.html +826 -0
- package/dist/examples/html-script/example-conversion.html +42 -49
- package/dist/examples/html-script/example-global-factory-classic.html +45 -0
- package/dist/examples/html-script/example-global-factory.html +40 -0
- package/dist/examples/html-script/example-integration.html +45 -51
- package/dist/examples/html-script/example-landing-commerce.html +416 -0
- package/dist/examples/html-script/example-runtime-diagnostics.html +108 -0
- package/dist/examples/html-script/example-transport.html +70 -63
- package/dist/examples/html-script/full-funnel/README.md +64 -0
- package/dist/examples/html-script/full-funnel/checkout.html +118 -0
- package/dist/examples/html-script/full-funnel/downsell.html +60 -0
- package/dist/examples/html-script/full-funnel/landing.html +153 -0
- package/dist/examples/html-script/full-funnel/thank-you.html +87 -0
- package/dist/examples/html-script/full-funnel/upsell.html +66 -0
- package/dist/examples/html-script/initiate-checkout/README.md +6 -6
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +135 -122
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +143 -128
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +144 -128
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +127 -120
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +136 -123
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +144 -131
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +146 -130
- package/dist/examples/html-script/internal-checkout/example-cardioclear-checkout.html +57 -0
- package/dist/examples/html-script/internal-checkout/example-slimsoda-checkout.html +53 -0
- package/dist/examples/html-script/lead/README.md +9 -7
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +107 -94
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +118 -103
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +118 -102
- package/dist/examples/html-script/release-candidate.html +219 -107
- package/dist/examples/html-script/remove-from-cart/README.md +4 -4
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +134 -121
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +134 -121
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +141 -128
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +125 -118
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +135 -122
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +136 -123
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +139 -124
- package/dist/examples/html-script/search/README.md +1 -1
- package/dist/examples/html-script/search/example-search-attribute.html +107 -99
- package/dist/examples/html-script/search/example-search-button-sync.html +107 -99
- package/dist/examples/html-script/search/example-search-dedupe.html +107 -99
- package/dist/examples/html-script/search/example-search-input.html +108 -99
- package/dist/examples/html-script/search/example-search-manual.html +98 -96
- package/dist/examples/html-script/search/example-search-submit.html +107 -99
- package/dist/examples/html-script/search/example-search-text.html +112 -99
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +92 -0
- package/dist/examples/html-script/url-context/example-url-context-landing.html +110 -0
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +105 -0
- package/dist/examples/html-script/url-context/example-url-context.html +205 -0
- package/dist/examples/html-script/view-content/README.md +1 -1
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +126 -118
- package/dist/examples/html-script/view-content/example-view-content-css.html +126 -118
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +126 -118
- package/dist/examples/html-script/view-content/example-view-content-empty.html +126 -118
- package/dist/examples/html-script/view-content/example-view-content-manual.html +117 -115
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +126 -118
- package/dist/examples/html-script/view-content/example-view-content-text.html +131 -121
- package/dist/examples/release-candidate/README.md +2 -1
- package/dist/examples/v2/README.md +16 -13
- package/dist/index-B8u_3PGG.d.ts +460 -0
- package/dist/index-BxT2d-TK.d.mts +460 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +23 -361
- package/dist/index.d.ts +23 -361
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/pixel-DNGbAN5C.d.ts +871 -0
- package/dist/pixel-_BSDpx4M.d.mts +871 -0
- package/dist/pixel-default-config-BMYaqs7i.d.ts +21 -0
- package/dist/pixel-default-config-DLRya1tl.d.mts +21 -0
- package/dist/pixel-settings-D-t9zQb4.d.ts +40 -0
- package/dist/pixel-settings-DGxl0MVm.d.mts +40 -0
- package/dist/runtime/index.cjs.js +1 -1
- package/dist/runtime/index.cjs.js.map +1 -1
- package/dist/runtime/index.d.mts +19 -26
- package/dist/runtime/index.d.ts +19 -26
- package/dist/runtime/index.esm.js +1 -1
- package/dist/runtime/index.esm.js.map +1 -1
- package/dist/services/index.cjs.js +1 -1
- package/dist/services/index.cjs.js.map +1 -1
- package/dist/services/index.d.mts +14 -6
- package/dist/services/index.d.ts +14 -6
- package/dist/services/index.esm.js +1 -1
- package/dist/services/index.esm.js.map +1 -1
- package/dist/types-B-Nzagpk.d.mts +19 -0
- package/dist/types-D0KVsgzs.d.mts +293 -0
- package/dist/types-D3kJ9bfT.d.ts +293 -0
- package/dist/types-Dfi9C49l.d.ts +19 -0
- package/dist/url-context-Ck2LK18V.d.mts +87 -0
- package/dist/url-context-Ck2LK18V.d.ts +87 -0
- package/dist/v2/global.global.js +1 -1
- package/dist/v2/global.global.js.map +1 -1
- package/dist/v2/index.cjs.js +1 -1
- package/dist/v2/index.cjs.js.map +1 -1
- package/dist/v2/index.d.mts +26 -6
- package/dist/v2/index.d.ts +26 -6
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/docs/public/README.md +80 -0
- package/docs/public/api/exports.md +56 -0
- package/docs/public/api/pixel.md +86 -0
- package/docs/public/configuration/commerce.md +44 -0
- package/docs/public/configuration/modules.md +63 -0
- package/docs/public/configuration/overview.md +85 -0
- package/docs/public/configuration/transport.md +127 -0
- package/docs/public/events/catalog.md +67 -0
- package/docs/public/getting-started/installation.md +88 -0
- package/docs/public/getting-started/quick-start.md +142 -0
- package/docs/public/getting-started/react-nextjs.md +78 -0
- package/docs/public/getting-started/script-tag.md +102 -0
- package/docs/public/guides/funnel-checkout.md +52 -0
- package/docs/public/guides/funnel-downsell.md +53 -0
- package/docs/public/guides/funnel-full.md +64 -0
- package/docs/public/guides/funnel-landing.md +70 -0
- package/docs/public/guides/funnel-thank-you.md +48 -0
- package/docs/public/guides/funnel-upsell.md +72 -0
- package/docs/public/limitations.md +33 -0
- package/docs/public/privacy/limitations.md +33 -0
- package/docs/public/release-candidate/validation.md +42 -0
- package/docs/public/troubleshooting.md +56 -0
- package/package.json +41 -20
- package/dist/index-DUfFzniE.d.mts +0 -274
- package/dist/index-DUfFzniE.d.ts +0 -274
- package/dist/pixel-CbeF25mD.d.mts +0 -555
- package/dist/pixel-CbeF25mD.d.ts +0 -555
- package/dist/pixel-default-config-1VgLFOiL.d.mts +0 -5
- package/dist/pixel-default-config-Bxb-Vdd8.d.ts +0 -5
- package/dist/types-CTpRvFKZ.d.ts +0 -71
- package/dist/types-DGlBdsAy.d.mts +0 -71
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
<div>
|
|
164
164
|
<label for="sender-mode">Sender</label>
|
|
165
165
|
<select id="sender-mode">
|
|
166
|
-
<option value="
|
|
167
|
-
<option value="
|
|
166
|
+
<option value="internal">Internal (endpoint público)</option>
|
|
167
|
+
<option value="test">Test (sem rede)</option>
|
|
168
168
|
</select>
|
|
169
169
|
</div>
|
|
170
170
|
</div>
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
</div>
|
|
196
196
|
|
|
197
197
|
<div class="card">
|
|
198
|
-
<h2>Auto — LEAD (
|
|
198
|
+
<h2>Auto — LEAD (source form · trigger auto)</h2>
|
|
199
199
|
<fieldset>
|
|
200
200
|
<legend>Campos (mode: any · fireOnce)</legend>
|
|
201
201
|
<div class="row">
|
|
@@ -235,22 +235,61 @@
|
|
|
235
235
|
</div>
|
|
236
236
|
|
|
237
237
|
<div class="card">
|
|
238
|
-
<h2>Auto —
|
|
238
|
+
<h2>Auto — Checkout (IC + ATC form + Payment)</h2>
|
|
239
|
+
<p class="sub">
|
|
240
|
+
lifecycle → IC no ready · email+phone → ATC form (1×) ·
|
|
241
|
+
editar address/cartão não re-dispara ATC · bump via data-track ·
|
|
242
|
+
cartão → ADD_PAYMENT_INFO (1×)
|
|
243
|
+
</p>
|
|
239
244
|
<form id="checkout-form">
|
|
240
245
|
<div class="row">
|
|
241
246
|
<div>
|
|
242
247
|
<label for="co-email">email</label>
|
|
243
|
-
<input id="co-email" name="email" type="email"
|
|
248
|
+
<input id="co-email" name="email" type="email" autocomplete="email" />
|
|
244
249
|
</div>
|
|
245
250
|
<div>
|
|
246
251
|
<label for="co-phone">phone</label>
|
|
247
|
-
<input id="co-phone" name="phone" type="tel"
|
|
252
|
+
<input id="co-phone" name="phone" type="tel" autocomplete="tel" />
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
<div class="row">
|
|
256
|
+
<div>
|
|
257
|
+
<label for="co-address">address</label>
|
|
258
|
+
<input id="co-address" name="address" type="text" autocomplete="street-address" />
|
|
259
|
+
</div>
|
|
260
|
+
<div>
|
|
261
|
+
<label for="co-city">city</label>
|
|
262
|
+
<input id="co-city" name="city" type="text" autocomplete="address-level2" />
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
<div class="row">
|
|
266
|
+
<div>
|
|
267
|
+
<label for="co-postal">postal</label>
|
|
268
|
+
<input id="co-postal" name="postal" type="text" autocomplete="postal-code" />
|
|
269
|
+
</div>
|
|
270
|
+
<div>
|
|
271
|
+
<label for="co-card">card (só detecta início — não envia número)</label>
|
|
272
|
+
<input
|
|
273
|
+
id="co-card"
|
|
274
|
+
name="card_number"
|
|
275
|
+
type="text"
|
|
276
|
+
autocomplete="cc-number"
|
|
277
|
+
inputmode="numeric"
|
|
278
|
+
placeholder="4111…"
|
|
279
|
+
/>
|
|
248
280
|
</div>
|
|
249
281
|
</div>
|
|
250
282
|
<div class="actions">
|
|
251
283
|
<button type="submit" class="primary" data-track="initiate_checkout">
|
|
252
284
|
Finalizar checkout
|
|
253
285
|
</button>
|
|
286
|
+
<button
|
|
287
|
+
type="button"
|
|
288
|
+
data-track="add_to_cart"
|
|
289
|
+
data-product-id="order_bump_01"
|
|
290
|
+
>
|
|
291
|
+
Order bump (selector ATC)
|
|
292
|
+
</button>
|
|
254
293
|
</div>
|
|
255
294
|
</form>
|
|
256
295
|
</div>
|
|
@@ -281,31 +320,29 @@
|
|
|
281
320
|
</div>
|
|
282
321
|
|
|
283
322
|
<div class="card">
|
|
284
|
-
<h2>Checklist manual
|
|
323
|
+
<h2>Checklist manual 14C</h2>
|
|
285
324
|
<ul class="checklist">
|
|
286
325
|
<li>[ ] window.PixelV2 existe</li>
|
|
287
326
|
<li>[ ] Pixel inicializa sem erro</li>
|
|
288
|
-
<li>[ ] PAGE_VIEW dispara no init
|
|
289
|
-
<li>[ ]
|
|
290
|
-
<li>[ ]
|
|
291
|
-
<li>[ ]
|
|
292
|
-
<li>[ ] ADD_TO_CART
|
|
293
|
-
<li>[ ]
|
|
294
|
-
<li>[ ]
|
|
295
|
-
<li>[ ] ADD_TO_CART
|
|
296
|
-
<li>[ ]
|
|
297
|
-
<li>[ ]
|
|
298
|
-
<li>[ ]
|
|
299
|
-
<li>[ ]
|
|
300
|
-
<li>[ ] destroy remove listeners</li>
|
|
301
|
-
<li>[ ]
|
|
302
|
-
<li>[ ] Transport Event real recebe ACK (HTTP)</li>
|
|
303
|
-
<li>[ ] Transport Batch real recebe ACK (modo Batch)</li>
|
|
327
|
+
<li>[ ] PAGE_VIEW dispara no init — sem commerce (pageView enrichment off)</li>
|
|
328
|
+
<li>[ ] INITIATE_CHECKOUT dispara por lifecycle no ready</li>
|
|
329
|
+
<li>[ ] email+phone no #checkout-form → ADD_TO_CART form (1×)</li>
|
|
330
|
+
<li>[ ] ADD_TO_CART form contém productId=main_offer</li>
|
|
331
|
+
<li>[ ] ADD_TO_CART form contém price/currency/quantity</li>
|
|
332
|
+
<li>[ ] editar address/city/postal depois não re-dispara ATC form</li>
|
|
333
|
+
<li>[ ] data-track="add_to_cart" / bump → ADD_TO_CART selector</li>
|
|
334
|
+
<li>[ ] ADD_TO_CART selector order bump contém productId=order_bump_01</li>
|
|
335
|
+
<li>[ ] preencher cartão → ADD_PAYMENT_INFO (1×, sem número no payload)</li>
|
|
336
|
+
<li>[ ] LEAD / ATC / IC / PURCHASE manuais funcionam</li>
|
|
337
|
+
<li>[ ] dedupe ATC <500ms</li>
|
|
338
|
+
<li>[ ] Transport ACK / Flush</li>
|
|
339
|
+
<li>[ ] destroy remove listeners / reinit não duplica</li>
|
|
340
|
+
<li>[ ] Transport Event/Batch real recebe ACK (HTTP)</li>
|
|
304
341
|
</ul>
|
|
305
342
|
</div>
|
|
306
343
|
</div>
|
|
307
344
|
|
|
308
|
-
<script src="../../
|
|
345
|
+
<script src="../../v2/global.global.js"></script>
|
|
309
346
|
<script>
|
|
310
347
|
(function () {
|
|
311
348
|
var params = new URLSearchParams(window.location.search);
|
|
@@ -434,11 +471,11 @@
|
|
|
434
471
|
var pixelId = pixelIdInput.value.trim();
|
|
435
472
|
var batchMode = document.getElementById('batch-mode').value;
|
|
436
473
|
var senderMode = document.getElementById('sender-mode').value;
|
|
437
|
-
var
|
|
474
|
+
var useInternal = senderMode === 'internal';
|
|
438
475
|
var batchSize = batchMode === 'batch' ? 10 : 1;
|
|
439
476
|
|
|
440
|
-
if (
|
|
441
|
-
throw new Error('Preencha PIXEL_API_ENDPOINT e PIXEL_ID para sender
|
|
477
|
+
if (useInternal && (!endpoint || !pixelId)) {
|
|
478
|
+
throw new Error('Preencha PIXEL_API_ENDPOINT e PIXEL_ID para sender internal.');
|
|
442
479
|
}
|
|
443
480
|
|
|
444
481
|
return {
|
|
@@ -455,9 +492,66 @@
|
|
|
455
492
|
},
|
|
456
493
|
transport: {
|
|
457
494
|
...DEFAULT_PIXEL_CONFIG.transport,
|
|
458
|
-
|
|
459
|
-
|
|
495
|
+
enabled: true,
|
|
496
|
+
sender: useInternal
|
|
497
|
+
? { mode: 'internal', baseUrl: endpoint }
|
|
498
|
+
: { mode: 'test', capture: true },
|
|
499
|
+
batch: {
|
|
500
|
+
...DEFAULT_PIXEL_CONFIG.transport.batch,
|
|
501
|
+
enabled: true,
|
|
502
|
+
batchSize: batchSize,
|
|
503
|
+
maxWaitMs: batchMode === 'batch' ? 8000 : 500,
|
|
504
|
+
},
|
|
505
|
+
flush: {
|
|
506
|
+
...DEFAULT_PIXEL_CONFIG.transport.flush,
|
|
507
|
+
flushOnDestroy: true,
|
|
508
|
+
},
|
|
509
|
+
timeout: {
|
|
510
|
+
...DEFAULT_PIXEL_CONFIG.transport.timeout,
|
|
511
|
+
timeoutMs: 15000,
|
|
512
|
+
},
|
|
513
|
+
coordination: { enabled: false },
|
|
460
514
|
},
|
|
515
|
+
commerce: {
|
|
516
|
+
enabled: true,
|
|
517
|
+
currency: 'BRL',
|
|
518
|
+
catalog: {
|
|
519
|
+
products: [
|
|
520
|
+
{
|
|
521
|
+
id: 'main_offer',
|
|
522
|
+
name: 'Oferta Principal RC',
|
|
523
|
+
type: 'main',
|
|
524
|
+
price: 197,
|
|
525
|
+
currency: 'BRL',
|
|
526
|
+
quantity: 1,
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
id: 'order_bump_01',
|
|
530
|
+
name: 'Order Bump RC',
|
|
531
|
+
type: 'order_bump',
|
|
532
|
+
price: 47,
|
|
533
|
+
currency: 'BRL',
|
|
534
|
+
quantity: 1,
|
|
535
|
+
},
|
|
536
|
+
],
|
|
537
|
+
},
|
|
538
|
+
cart: {
|
|
539
|
+
mode: 'single_product',
|
|
540
|
+
initialItems: [{ productId: 'main_offer', quantity: 1 }],
|
|
541
|
+
calculateValueFrom: 'cart',
|
|
542
|
+
allowDynamicItems: true,
|
|
543
|
+
},
|
|
544
|
+
enrichment: {
|
|
545
|
+
pageView: { enabled: false, source: 'cart' },
|
|
546
|
+
viewContent: { enabled: true, source: 'event_or_cart' },
|
|
547
|
+
lead: { enabled: false, source: 'event_or_cart' },
|
|
548
|
+
addToCart: { enabled: true, source: 'event_or_cart' },
|
|
549
|
+
removeFromCart: { enabled: true, source: 'event_or_cart' },
|
|
550
|
+
initiateCheckout: { enabled: true, source: 'cart' },
|
|
551
|
+
addPaymentInfo: { enabled: true, source: 'cart' },
|
|
552
|
+
purchase: { enabled: true, source: 'cart' },
|
|
553
|
+
}
|
|
554
|
+
},
|
|
461
555
|
modules: {
|
|
462
556
|
...DEFAULT_PIXEL_CONFIG.modules,
|
|
463
557
|
privacy: { ...DEFAULT_PIXEL_CONFIG.modules.privacy, enabled: false },
|
|
@@ -475,39 +569,22 @@
|
|
|
475
569
|
trackInitialPageView: true,
|
|
476
570
|
spa: false,
|
|
477
571
|
},
|
|
572
|
+
// sid público ≠ session_id interno do Pixel
|
|
573
|
+
urlContext: {
|
|
574
|
+
enabled: true,
|
|
575
|
+
linkDecoration: {
|
|
576
|
+
enabled: true,
|
|
577
|
+
strategy: 'on_click',
|
|
578
|
+
allowedDomains: [
|
|
579
|
+
'checkout.bemony.com',
|
|
580
|
+
'security.bemony.com',
|
|
581
|
+
],
|
|
582
|
+
},
|
|
583
|
+
},
|
|
478
584
|
},
|
|
479
585
|
conversion: {
|
|
480
586
|
...DEFAULT_PIXEL_CONFIG.modules.conversion,
|
|
481
587
|
enabled: true,
|
|
482
|
-
commerce: {
|
|
483
|
-
currency: 'BRL',
|
|
484
|
-
catalog: {
|
|
485
|
-
products: [
|
|
486
|
-
{
|
|
487
|
-
id: 'main_offer',
|
|
488
|
-
name: 'Oferta Principal RC',
|
|
489
|
-
type: 'main',
|
|
490
|
-
price: 197,
|
|
491
|
-
currency: 'BRL',
|
|
492
|
-
quantity: 1,
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
id: 'order_bump_01',
|
|
496
|
-
name: 'Order Bump RC',
|
|
497
|
-
type: 'order_bump',
|
|
498
|
-
price: 47,
|
|
499
|
-
currency: 'BRL',
|
|
500
|
-
quantity: 1,
|
|
501
|
-
},
|
|
502
|
-
],
|
|
503
|
-
},
|
|
504
|
-
checkout: {
|
|
505
|
-
mode: 'single_product',
|
|
506
|
-
selectedItems: [{ productId: 'main_offer', quantity: 1 }],
|
|
507
|
-
calculateValueFrom: 'selected_items',
|
|
508
|
-
allowDynamicItems: true,
|
|
509
|
-
},
|
|
510
|
-
},
|
|
511
588
|
manual: {
|
|
512
589
|
pageView: { enabled: false },
|
|
513
590
|
purchase: { enabled: true },
|
|
@@ -524,39 +601,90 @@
|
|
|
524
601
|
detectors: {
|
|
525
602
|
lead: {
|
|
526
603
|
enabled: true,
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
604
|
+
sources: [
|
|
605
|
+
{
|
|
606
|
+
name: 'lead-form',
|
|
607
|
+
type: 'form',
|
|
608
|
+
selector: '#lead-email, #lead-phone',
|
|
609
|
+
selectorType: 'css',
|
|
610
|
+
selectorForm: {
|
|
611
|
+
fields: ['email', 'phone'],
|
|
612
|
+
mode: 'any',
|
|
613
|
+
trigger: 'auto',
|
|
614
|
+
fireOnce: true,
|
|
615
|
+
minRequired: 1,
|
|
616
|
+
},
|
|
617
|
+
},
|
|
618
|
+
],
|
|
536
619
|
},
|
|
537
620
|
addToCart: {
|
|
538
621
|
enabled: true,
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
622
|
+
sources: [
|
|
623
|
+
{
|
|
624
|
+
name: 'main-product-after-contact',
|
|
625
|
+
type: 'form',
|
|
626
|
+
selectorForm: {
|
|
627
|
+
fields: ['email', 'phone'],
|
|
628
|
+
mode: 'all',
|
|
629
|
+
formSelector: '#checkout-form',
|
|
630
|
+
trigger: 'input',
|
|
631
|
+
debounceMs: 300,
|
|
632
|
+
fireOnce: true,
|
|
633
|
+
},
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
name: 'product-or-bump-click',
|
|
637
|
+
type: 'selector',
|
|
638
|
+
selector: ['[data-track="add_to_cart"]', 'text:Comprar agora'],
|
|
639
|
+
selectorType: 'css',
|
|
640
|
+
trigger: 'click',
|
|
641
|
+
fireOnce: false,
|
|
642
|
+
},
|
|
643
|
+
],
|
|
542
644
|
},
|
|
543
645
|
initiateCheckout: {
|
|
544
646
|
enabled: true,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
647
|
+
sources: [
|
|
648
|
+
{
|
|
649
|
+
name: 'checkout-loaded',
|
|
650
|
+
type: 'lifecycle',
|
|
651
|
+
trigger: 'ready',
|
|
652
|
+
fireOnce: true,
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
name: 'checkout-form-submit',
|
|
656
|
+
type: 'form',
|
|
657
|
+
selector: ['#checkout-form', '[data-track="initiate_checkout"]'],
|
|
658
|
+
selectorType: 'css',
|
|
659
|
+
selectorForm: {
|
|
660
|
+
fields: ['email', 'phone'],
|
|
661
|
+
mode: 'all',
|
|
662
|
+
formSelector: '#checkout-form',
|
|
663
|
+
trigger: 'submit',
|
|
664
|
+
fireOnce: false,
|
|
665
|
+
minRequired: 2,
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
],
|
|
554
669
|
},
|
|
555
|
-
purchase: { enabled: false },
|
|
556
|
-
removeFromCart: { enabled: false },
|
|
557
|
-
addPaymentInfo: {
|
|
558
|
-
|
|
559
|
-
|
|
670
|
+
purchase: { enabled: false, sources: [] },
|
|
671
|
+
removeFromCart: { enabled: false, sources: [] },
|
|
672
|
+
addPaymentInfo: {
|
|
673
|
+
enabled: true,
|
|
674
|
+
sources: [
|
|
675
|
+
{
|
|
676
|
+
name: 'credit-card-detection',
|
|
677
|
+
type: 'payment',
|
|
678
|
+
formSelector: '#checkout-form',
|
|
679
|
+
cardDetection: true,
|
|
680
|
+
autoDispatch: true,
|
|
681
|
+
fireOnce: true,
|
|
682
|
+
paymentMethod: 'CREDIT_CARD',
|
|
683
|
+
},
|
|
684
|
+
],
|
|
685
|
+
},
|
|
686
|
+
search: { enabled: false, sources: [] },
|
|
687
|
+
viewContent: { enabled: false, sources: [] },
|
|
560
688
|
},
|
|
561
689
|
},
|
|
562
690
|
rules: {
|
|
@@ -564,29 +692,6 @@
|
|
|
564
692
|
enabled: false,
|
|
565
693
|
},
|
|
566
694
|
},
|
|
567
|
-
transport: {
|
|
568
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport,
|
|
569
|
-
enabled: true,
|
|
570
|
-
mockSender: { enabled: !useHttp },
|
|
571
|
-
sender: { mode: useHttp ? 'http' : 'mock' },
|
|
572
|
-
batch: {
|
|
573
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport.batch,
|
|
574
|
-
enabled: true,
|
|
575
|
-
batchSize: batchSize,
|
|
576
|
-
flushIntervalMs: batchMode === 'batch' ? 8000 : 200,
|
|
577
|
-
maxWaitMs: batchMode === 'batch' ? 8000 : 500,
|
|
578
|
-
},
|
|
579
|
-
flush: {
|
|
580
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport.flush,
|
|
581
|
-
flushIntervalMs: batchMode === 'batch' ? 8000 : 200,
|
|
582
|
-
flushOnDestroy: true,
|
|
583
|
-
},
|
|
584
|
-
timeout: {
|
|
585
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport.timeout,
|
|
586
|
-
timeoutMs: 15000,
|
|
587
|
-
},
|
|
588
|
-
coordination: { enabled: false },
|
|
589
|
-
},
|
|
590
695
|
},
|
|
591
696
|
};
|
|
592
697
|
}
|
|
@@ -620,6 +725,13 @@
|
|
|
620
725
|
var Pixel = window.PixelV2.Pixel;
|
|
621
726
|
pixel = new Pixel(buildConfig());
|
|
622
727
|
await pixel.init();
|
|
728
|
+
if (document.getElementById('sender-mode').value === 'test') {
|
|
729
|
+
pixel.configureTransportTestSender({
|
|
730
|
+
capture: true,
|
|
731
|
+
response: 'success',
|
|
732
|
+
delayMs: 0,
|
|
733
|
+
});
|
|
734
|
+
}
|
|
623
735
|
initCount += 1;
|
|
624
736
|
|
|
625
737
|
var services = pixel.getDebugServices();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Cada HTML valida **um** comportamento. Abra um de cada vez.
|
|
4
4
|
|
|
5
|
-
> **Nota:** `removeFromCart` **não** tem `
|
|
5
|
+
> **Nota:** `removeFromCart` **não** tem `sources[]` com `type: 'form'` (só selector).
|
|
6
6
|
> Fontes: payload manual, `data-product-id`, commerce state.
|
|
7
7
|
|
|
8
8
|
| # | Arquivo | Como dispara | O que valida |
|
|
@@ -12,16 +12,16 @@ Cada HTML valida **um** comportamento. Abra um de cada vez.
|
|
|
12
12
|
| 3 | [`example-remove-from-cart-css.html`](./example-remove-from-cart-css.html) | `.remove-from-cart` | Seletor CSS class |
|
|
13
13
|
| 4 | [`example-remove-from-cart-manual.html`](./example-remove-from-cart-manual.html) | `pixel.removeFromCart()` | API + sem productId |
|
|
14
14
|
| 5 | [`example-remove-from-cart-state.html`](./example-remove-from-cart-state.html) | atributo + state | `removeItem` / cart mirror |
|
|
15
|
-
| 6 | [`example-remove-from-cart-dedupe.html`](./example-remove-from-cart-dedupe.html) | clique / API | Dedupe por `productId` (
|
|
15
|
+
| 6 | [`example-remove-from-cart-dedupe.html`](./example-remove-from-cart-dedupe.html) | clique / API | Dedupe por `productId` (janela 500ms) |
|
|
16
16
|
| 7 | [`example-remove-from-cart-multi.html`](./example-remove-from-cart-multi.html) | multi botões | Remoção seletiva de 3 itens |
|
|
17
17
|
|
|
18
18
|
## Dedupe (importante)
|
|
19
19
|
|
|
20
20
|
```txt
|
|
21
|
-
REMOVE_FROM_CART:product:{productId}
|
|
21
|
+
REMOVE_FROM_CART:product:{productId}:qty:{n}:bucket:{t}
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Mesma janela de ~500ms do ADD. Clique duplo no mesmo id é 1 evento; add → remove → add → remove dispara de novo após a janela.
|
|
25
25
|
|
|
26
26
|
## Como abrir
|
|
27
27
|
|