@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.
- package/CHANGELOG.md +251 -4
- package/README.md +89 -111
- package/RELEASE_CANDIDATE.md +181 -36
- package/dist/{StorageFactory-BhpbB6Jj.d.mts → StorageFactory-CPghDPBj.d.mts} +2 -2
- package/dist/{StorageFactory-CAkJJqVD.d.ts → StorageFactory-tjfzk57c.d.ts} +2 -2
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.mts +4 -3
- package/dist/config/index.d.ts +4 -3
- 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 +24 -2
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +20 -6
- 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 +66 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +66 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +73 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +56 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +65 -47
- package/dist/examples/html-script/add-to-cart/README.md +3 -3
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +103 -81
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +101 -78
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +81 -67
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +104 -81
- 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/example-checkout-commerce.html +825 -0
- package/dist/examples/html-script/example-integration.html +5 -5
- package/dist/examples/html-script/example-landing-commerce.html +380 -0
- package/dist/examples/html-script/example-runtime-diagnostics.html +108 -0
- package/dist/examples/html-script/example-transport.html +5 -5
- package/dist/examples/html-script/full-funnel/README.md +64 -0
- package/dist/examples/html-script/full-funnel/checkout.html +116 -0
- package/dist/examples/html-script/full-funnel/downsell.html +58 -0
- package/dist/examples/html-script/full-funnel/landing.html +99 -0
- package/dist/examples/html-script/full-funnel/thank-you.html +85 -0
- package/dist/examples/html-script/full-funnel/upsell.html +64 -0
- package/dist/examples/html-script/initiate-checkout/README.md +6 -6
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +94 -74
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +102 -80
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +103 -80
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +86 -72
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +95 -75
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +103 -83
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +105 -82
- package/dist/examples/html-script/lead/README.md +9 -7
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +67 -47
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +78 -56
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +78 -55
- package/dist/examples/html-script/release-candidate.html +187 -76
- package/dist/examples/html-script/remove-from-cart/README.md +1 -1
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +84 -70
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +94 -74
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +95 -75
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +98 -76
- package/dist/examples/html-script/search/README.md +1 -1
- package/dist/examples/html-script/search/example-search-attribute.html +66 -51
- package/dist/examples/html-script/search/example-search-button-sync.html +66 -51
- package/dist/examples/html-script/search/example-search-dedupe.html +66 -51
- package/dist/examples/html-script/search/example-search-input.html +67 -51
- package/dist/examples/html-script/search/example-search-manual.html +57 -48
- package/dist/examples/html-script/search/example-search-submit.html +66 -51
- package/dist/examples/html-script/search/example-search-text.html +71 -51
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +63 -0
- package/dist/examples/html-script/url-context/example-url-context-landing.html +70 -0
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +67 -0
- package/dist/examples/html-script/url-context/example-url-context.html +171 -0
- package/dist/examples/html-script/view-content/README.md +1 -1
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-css.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-empty.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-manual.html +76 -67
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-text.html +90 -73
- package/dist/examples/v2/README.md +4 -1
- package/dist/{index-DUfFzniE.d.ts → index-CQAyT5Od.d.ts} +170 -3
- package/dist/{index-DUfFzniE.d.mts → index-JlKPz4pp.d.mts} +170 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +435 -12
- package/dist/index.d.ts +435 -12
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/{pixel-CbeF25mD.d.mts → pixel-BxZZx8l5.d.ts} +248 -72
- package/dist/{pixel-CbeF25mD.d.ts → pixel-CKc4OQUx.d.mts} +248 -72
- package/dist/{pixel-default-config-1VgLFOiL.d.mts → pixel-default-config-CJl-eypl.d.mts} +1 -1
- package/dist/{pixel-default-config-Bxb-Vdd8.d.ts → pixel-default-config-aAOujzwp.d.ts} +1 -1
- 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-BP8dz1gP.d.mts +19 -0
- package/dist/types-C75pQP31.d.ts +19 -0
- package/dist/types-DMhzHSVC.d.mts +293 -0
- package/dist/types-D_SsCur9.d.ts +293 -0
- package/dist/url-context-BjAsQoVl.d.mts +85 -0
- package/dist/url-context-BjAsQoVl.d.ts +85 -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 +8 -6
- package/dist/v2/index.d.ts +8 -6
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/package.json +12 -1
- package/dist/types-CTpRvFKZ.d.ts +0 -71
- package/dist/types-DGlBdsAy.d.mts +0 -71
|
@@ -182,11 +182,18 @@ code { font-size: 0.85em; }
|
|
|
182
182
|
|
|
183
183
|
function addPaymentInfoDetectorConfig() {
|
|
184
184
|
return {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
enabled: true,
|
|
186
|
+
sources: [
|
|
187
|
+
{
|
|
188
|
+
name: 'credit-card-detection',
|
|
189
|
+
type: 'payment',
|
|
190
|
+
paymentMethod: 'CREDIT_CARD',
|
|
191
|
+
cardDetection: false,
|
|
192
|
+
autoDispatch: true,
|
|
193
|
+
fireOnce: true
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
};
|
|
190
197
|
}
|
|
191
198
|
|
|
192
199
|
function rulesConfig() {
|
|
@@ -216,6 +223,45 @@ code { font-size: 0.85em; }
|
|
|
216
223
|
timeoutMs: 10000,
|
|
217
224
|
},
|
|
218
225
|
identity: { ...base.identity, pixelId: PIXEL_ID },
|
|
226
|
+
commerce: {
|
|
227
|
+
enabled: true,
|
|
228
|
+
currency: 'BRL',
|
|
229
|
+
catalog: { products: [] },
|
|
230
|
+
cart: {
|
|
231
|
+
mode: 'single_product',
|
|
232
|
+
initialItems: [],
|
|
233
|
+
calculateValueFrom: 'cart',
|
|
234
|
+
allowDynamicItems: true,
|
|
235
|
+
},
|
|
236
|
+
mappings: {
|
|
237
|
+
attributes: {
|
|
238
|
+
productId: ['data-product-id'],
|
|
239
|
+
productName: ['data-product-name'],
|
|
240
|
+
price: ['data-product-price'],
|
|
241
|
+
quantity: ['data-quantity'],
|
|
242
|
+
currency: ['data-currency'],
|
|
243
|
+
},
|
|
244
|
+
fields: {
|
|
245
|
+
email: ['email'],
|
|
246
|
+
phone: ['phone'],
|
|
247
|
+
productId: ['productId'],
|
|
248
|
+
productName: ['productName'],
|
|
249
|
+
price: ['price'],
|
|
250
|
+
quantity: ['quantity'],
|
|
251
|
+
currency: ['currency'],
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
enrichment: {
|
|
255
|
+
pageView: { enabled: false, source: 'cart' },
|
|
256
|
+
viewContent: { enabled: true, source: 'event_or_cart' },
|
|
257
|
+
lead: { enabled: false, source: 'event_or_cart' },
|
|
258
|
+
addToCart: { enabled: true, source: 'event_or_cart' },
|
|
259
|
+
removeFromCart: { enabled: true, source: 'event_or_cart' },
|
|
260
|
+
initiateCheckout: { enabled: true, source: 'cart' },
|
|
261
|
+
addPaymentInfo: { enabled: true, source: 'cart' },
|
|
262
|
+
purchase: { enabled: true, source: 'cart' },
|
|
263
|
+
}
|
|
264
|
+
},
|
|
219
265
|
modules: {
|
|
220
266
|
...base.modules,
|
|
221
267
|
core: {
|
|
@@ -277,56 +323,28 @@ code { font-size: 0.85em; }
|
|
|
277
323
|
integrations: { ...base.modules.integrations, enabled: false },
|
|
278
324
|
conversion: {
|
|
279
325
|
enabled: true,
|
|
280
|
-
commerce: {
|
|
281
|
-
currency: 'BRL',
|
|
282
|
-
catalog: { products: [] },
|
|
283
|
-
checkout: {
|
|
284
|
-
mode: 'single_product',
|
|
285
|
-
selectedItems: [],
|
|
286
|
-
calculateValueFrom: 'selected_items',
|
|
287
|
-
allowDynamicItems: true,
|
|
288
|
-
},
|
|
289
|
-
mappings: {
|
|
290
|
-
attributes: {
|
|
291
|
-
productId: ['data-product-id'],
|
|
292
|
-
productName: ['data-product-name'],
|
|
293
|
-
price: ['data-product-price'],
|
|
294
|
-
quantity: ['data-quantity'],
|
|
295
|
-
currency: ['data-currency'],
|
|
296
|
-
},
|
|
297
|
-
fields: {
|
|
298
|
-
email: ['email'],
|
|
299
|
-
phone: ['phone'],
|
|
300
|
-
productId: ['productId'],
|
|
301
|
-
productName: ['productName'],
|
|
302
|
-
price: ['price'],
|
|
303
|
-
quantity: ['quantity'],
|
|
304
|
-
currency: ['currency'],
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
326
|
manual: {
|
|
309
327
|
pageView: { enabled: false },
|
|
310
|
-
purchase: { enabled: false },
|
|
311
|
-
lead: { enabled: false },
|
|
312
|
-
addToCart: { enabled: false },
|
|
313
|
-
removeFromCart: { enabled: false },
|
|
314
|
-
initiateCheckout: { enabled: false },
|
|
328
|
+
purchase: { enabled: false, sources: [] },
|
|
329
|
+
lead: { enabled: false, sources: [] },
|
|
330
|
+
addToCart: { enabled: false, sources: [] },
|
|
331
|
+
removeFromCart: { enabled: false, sources: [] },
|
|
332
|
+
initiateCheckout: { enabled: false, sources: [] },
|
|
315
333
|
addPaymentInfo: { enabled: true },
|
|
316
|
-
search: { enabled: false },
|
|
317
|
-
viewContent: { enabled: false },
|
|
334
|
+
search: { enabled: false, sources: [] },
|
|
335
|
+
viewContent: { enabled: false, sources: [] },
|
|
318
336
|
},
|
|
319
337
|
auto: {
|
|
320
338
|
enabled: true,
|
|
321
339
|
detectors: {
|
|
322
|
-
lead: { enabled: false },
|
|
323
|
-
purchase: { enabled: false },
|
|
324
|
-
addToCart: { enabled: false },
|
|
325
|
-
removeFromCart: { enabled: false },
|
|
326
|
-
initiateCheckout: { enabled: false },
|
|
340
|
+
lead: { enabled: false, sources: [] },
|
|
341
|
+
purchase: { enabled: false, sources: [] },
|
|
342
|
+
addToCart: { enabled: false, sources: [] },
|
|
343
|
+
removeFromCart: { enabled: false, sources: [] },
|
|
344
|
+
initiateCheckout: { enabled: false, sources: [] },
|
|
327
345
|
addPaymentInfo: addPaymentInfoDetectorConfig(),
|
|
328
|
-
search: { enabled: false },
|
|
329
|
-
viewContent: { enabled: false },
|
|
346
|
+
search: { enabled: false, sources: [] },
|
|
347
|
+
viewContent: { enabled: false, sources: [] },
|
|
330
348
|
},
|
|
331
349
|
},
|
|
332
350
|
rules: rulesConfig(),
|
|
@@ -202,11 +202,18 @@ code { font-size: 0.85em; }
|
|
|
202
202
|
|
|
203
203
|
function addPaymentInfoDetectorConfig() {
|
|
204
204
|
return {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
205
|
+
enabled: true,
|
|
206
|
+
sources: [
|
|
207
|
+
{
|
|
208
|
+
name: 'credit-card-detection',
|
|
209
|
+
type: 'payment',
|
|
210
|
+
paymentMethod: 'CREDIT_CARD',
|
|
211
|
+
cardDetection: true,
|
|
212
|
+
autoDispatch: true,
|
|
213
|
+
fireOnce: true
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
};
|
|
210
217
|
}
|
|
211
218
|
|
|
212
219
|
function rulesConfig() {
|
|
@@ -236,6 +243,45 @@ code { font-size: 0.85em; }
|
|
|
236
243
|
timeoutMs: 10000,
|
|
237
244
|
},
|
|
238
245
|
identity: { ...base.identity, pixelId: PIXEL_ID },
|
|
246
|
+
commerce: {
|
|
247
|
+
enabled: true,
|
|
248
|
+
currency: 'BRL',
|
|
249
|
+
catalog: { products: [] },
|
|
250
|
+
cart: {
|
|
251
|
+
mode: 'single_product',
|
|
252
|
+
initialItems: [],
|
|
253
|
+
calculateValueFrom: 'cart',
|
|
254
|
+
allowDynamicItems: true,
|
|
255
|
+
},
|
|
256
|
+
mappings: {
|
|
257
|
+
attributes: {
|
|
258
|
+
productId: ['data-product-id'],
|
|
259
|
+
productName: ['data-product-name'],
|
|
260
|
+
price: ['data-product-price'],
|
|
261
|
+
quantity: ['data-quantity'],
|
|
262
|
+
currency: ['data-currency'],
|
|
263
|
+
},
|
|
264
|
+
fields: {
|
|
265
|
+
email: ['email'],
|
|
266
|
+
phone: ['phone'],
|
|
267
|
+
productId: ['productId'],
|
|
268
|
+
productName: ['productName'],
|
|
269
|
+
price: ['price'],
|
|
270
|
+
quantity: ['quantity'],
|
|
271
|
+
currency: ['currency'],
|
|
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
|
+
},
|
|
239
285
|
modules: {
|
|
240
286
|
...base.modules,
|
|
241
287
|
core: {
|
|
@@ -297,56 +343,28 @@ code { font-size: 0.85em; }
|
|
|
297
343
|
integrations: { ...base.modules.integrations, enabled: false },
|
|
298
344
|
conversion: {
|
|
299
345
|
enabled: true,
|
|
300
|
-
commerce: {
|
|
301
|
-
currency: 'BRL',
|
|
302
|
-
catalog: { products: [] },
|
|
303
|
-
checkout: {
|
|
304
|
-
mode: 'single_product',
|
|
305
|
-
selectedItems: [],
|
|
306
|
-
calculateValueFrom: 'selected_items',
|
|
307
|
-
allowDynamicItems: true,
|
|
308
|
-
},
|
|
309
|
-
mappings: {
|
|
310
|
-
attributes: {
|
|
311
|
-
productId: ['data-product-id'],
|
|
312
|
-
productName: ['data-product-name'],
|
|
313
|
-
price: ['data-product-price'],
|
|
314
|
-
quantity: ['data-quantity'],
|
|
315
|
-
currency: ['data-currency'],
|
|
316
|
-
},
|
|
317
|
-
fields: {
|
|
318
|
-
email: ['email'],
|
|
319
|
-
phone: ['phone'],
|
|
320
|
-
productId: ['productId'],
|
|
321
|
-
productName: ['productName'],
|
|
322
|
-
price: ['price'],
|
|
323
|
-
quantity: ['quantity'],
|
|
324
|
-
currency: ['currency'],
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
},
|
|
328
346
|
manual: {
|
|
329
347
|
pageView: { enabled: false },
|
|
330
|
-
purchase: { enabled: false },
|
|
331
|
-
lead: { enabled: false },
|
|
332
|
-
addToCart: { enabled: false },
|
|
333
|
-
removeFromCart: { enabled: false },
|
|
334
|
-
initiateCheckout: { enabled: false },
|
|
348
|
+
purchase: { enabled: false, sources: [] },
|
|
349
|
+
lead: { enabled: false, sources: [] },
|
|
350
|
+
addToCart: { enabled: false, sources: [] },
|
|
351
|
+
removeFromCart: { enabled: false, sources: [] },
|
|
352
|
+
initiateCheckout: { enabled: false, sources: [] },
|
|
335
353
|
addPaymentInfo: { enabled: true },
|
|
336
|
-
search: { enabled: false },
|
|
337
|
-
viewContent: { enabled: false },
|
|
354
|
+
search: { enabled: false, sources: [] },
|
|
355
|
+
viewContent: { enabled: false, sources: [] },
|
|
338
356
|
},
|
|
339
357
|
auto: {
|
|
340
358
|
enabled: true,
|
|
341
359
|
detectors: {
|
|
342
|
-
lead: { enabled: false },
|
|
343
|
-
purchase: { enabled: false },
|
|
344
|
-
addToCart: { enabled: false },
|
|
345
|
-
removeFromCart: { enabled: false },
|
|
346
|
-
initiateCheckout: { enabled: false },
|
|
360
|
+
lead: { enabled: false, sources: [] },
|
|
361
|
+
purchase: { enabled: false, sources: [] },
|
|
362
|
+
addToCart: { enabled: false, sources: [] },
|
|
363
|
+
removeFromCart: { enabled: false, sources: [] },
|
|
364
|
+
initiateCheckout: { enabled: false, sources: [] },
|
|
347
365
|
addPaymentInfo: addPaymentInfoDetectorConfig(),
|
|
348
|
-
search: { enabled: false },
|
|
349
|
-
viewContent: { enabled: false },
|
|
366
|
+
search: { enabled: false, sources: [] },
|
|
367
|
+
viewContent: { enabled: false, sources: [] },
|
|
350
368
|
},
|
|
351
369
|
},
|
|
352
370
|
rules: rulesConfig(),
|
|
@@ -5,8 +5,8 @@ Cada HTML valida **um** comportamento. Abra um de cada vez.
|
|
|
5
5
|
| # | Arquivo | Como dispara | O que valida |
|
|
6
6
|
|---|---------|--------------|--------------|
|
|
7
7
|
| 1 | [`example-add-to-cart-attribute.html`](./example-add-to-cart-attribute.html) | `[data-track="add_to_cart"]` + `data-product-*` | SelectorDetector + ProductExtractor + enrich catalog |
|
|
8
|
-
| 2 | [`example-add-to-cart-click.html`](./example-add-to-cart-click.html) | `
|
|
9
|
-
| 3 | [`example-add-to-cart-auto.html`](./example-add-to-cart-auto.html) | `
|
|
8
|
+
| 2 | [`example-add-to-cart-click.html`](./example-add-to-cart-click.html) | source `type: form` + `trigger: click` | Gate email+phone antes do CTA |
|
|
9
|
+
| 3 | [`example-add-to-cart-auto.html`](./example-add-to-cart-auto.html) | source `type: form` + `trigger: auto` | Disparo ao completar contato (`fireOnce`) |
|
|
10
10
|
| 4 | [`example-add-to-cart-text.html`](./example-add-to-cart-text.html) | `text:Comprar agora` + form | Match por texto + condição de form |
|
|
11
11
|
| 5 | [`example-add-to-cart-manual.html`](./example-add-to-cart-manual.html) | `pixel.addToCart()` | Payload manual, catalog, override de preço |
|
|
12
12
|
| 6 | [`example-add-to-cart-dedupe.html`](./example-add-to-cart-dedupe.html) | clique / API rápida | Janela ~500ms sem bloquear ação futura |
|
|
@@ -18,7 +18,7 @@ Cada HTML valida **um** comportamento. Abra um de cada vez.
|
|
|
18
18
|
1. Payload manual
|
|
19
19
|
2. data-* do elemento
|
|
20
20
|
3. campos do formulário
|
|
21
|
-
4.
|
|
21
|
+
4. `cart.initialItems`
|
|
22
22
|
5. catálogo commerce
|
|
23
23
|
6. defaults
|
|
24
24
|
```
|
|
@@ -208,10 +208,19 @@ code { font-size: 0.85em; }
|
|
|
208
208
|
|
|
209
209
|
function addToCartDetectorConfig() {
|
|
210
210
|
return {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
enabled: true,
|
|
212
|
+
sources: [
|
|
213
|
+
{
|
|
214
|
+
name: 'addToCart-selector',
|
|
215
|
+
type: 'selector',
|
|
216
|
+
selector: [
|
|
217
|
+
'[data-track=\'add_to_cart\']'
|
|
218
|
+
],
|
|
219
|
+
selectorType: 'css',
|
|
220
|
+
trigger: 'click'
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
};
|
|
215
224
|
}
|
|
216
225
|
|
|
217
226
|
function buildConfig() {
|
|
@@ -230,6 +239,70 @@ code { font-size: 0.85em; }
|
|
|
230
239
|
timeoutMs: 10000,
|
|
231
240
|
},
|
|
232
241
|
identity: { ...base.identity, pixelId: PIXEL_ID },
|
|
242
|
+
commerce: {
|
|
243
|
+
enabled: true,
|
|
244
|
+
currency: 'BRL',
|
|
245
|
+
catalog: { products: [
|
|
246
|
+
{
|
|
247
|
+
id: 'main_offer',
|
|
248
|
+
name: 'Oferta Principal',
|
|
249
|
+
type: 'main',
|
|
250
|
+
price: 197,
|
|
251
|
+
currency: 'BRL',
|
|
252
|
+
quantity: 1,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: 'order_bump_01',
|
|
256
|
+
name: 'Order Bump Especial',
|
|
257
|
+
type: 'order_bump',
|
|
258
|
+
price: 47,
|
|
259
|
+
currency: 'BRL',
|
|
260
|
+
quantity: 1,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 'upsell_01',
|
|
264
|
+
name: 'Upsell 01',
|
|
265
|
+
type: 'upsell',
|
|
266
|
+
price: 97,
|
|
267
|
+
currency: 'BRL',
|
|
268
|
+
quantity: 1,
|
|
269
|
+
},
|
|
270
|
+
] },
|
|
271
|
+
cart: {
|
|
272
|
+
mode: 'single_product',
|
|
273
|
+
initialItems: [{ productId: "main_offer", quantity: 1 }],
|
|
274
|
+
calculateValueFrom: 'cart',
|
|
275
|
+
allowDynamicItems: true,
|
|
276
|
+
},
|
|
277
|
+
mappings: {
|
|
278
|
+
attributes: {
|
|
279
|
+
productId: ['data-product-id', 'data-sku', 'data-offer-id'],
|
|
280
|
+
productName: ['data-product-name', 'data-name'],
|
|
281
|
+
price: ['data-product-price', 'data-price'],
|
|
282
|
+
quantity: ['data-quantity', 'data-qty'],
|
|
283
|
+
currency: ['data-currency'],
|
|
284
|
+
},
|
|
285
|
+
fields: {
|
|
286
|
+
productId: ['productId', 'product_id', 'offerId', 'sku'],
|
|
287
|
+
productName: ['productName', 'product_name'],
|
|
288
|
+
price: ['price', 'amount'],
|
|
289
|
+
quantity: ['quantity', 'qty'],
|
|
290
|
+
currency: ['currency'],
|
|
291
|
+
email: ['email', 'customerEmail'],
|
|
292
|
+
phone: ['phone', 'telefone', 'customerPhone'],
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
enrichment: {
|
|
296
|
+
pageView: { enabled: false, source: 'cart' },
|
|
297
|
+
viewContent: { enabled: true, source: 'event_or_cart' },
|
|
298
|
+
lead: { enabled: false, source: 'event_or_cart' },
|
|
299
|
+
addToCart: { enabled: true, source: 'event_or_cart' },
|
|
300
|
+
removeFromCart: { enabled: true, source: 'event_or_cart' },
|
|
301
|
+
initiateCheckout: { enabled: true, source: 'cart' },
|
|
302
|
+
addPaymentInfo: { enabled: true, source: 'cart' },
|
|
303
|
+
purchase: { enabled: true, source: 'cart' },
|
|
304
|
+
}
|
|
305
|
+
},
|
|
233
306
|
modules: {
|
|
234
307
|
...base.modules,
|
|
235
308
|
core: {
|
|
@@ -291,81 +364,28 @@ code { font-size: 0.85em; }
|
|
|
291
364
|
integrations: { ...base.modules.integrations, enabled: false },
|
|
292
365
|
conversion: {
|
|
293
366
|
enabled: true,
|
|
294
|
-
commerce: {
|
|
295
|
-
currency: 'BRL',
|
|
296
|
-
catalog: { products: [
|
|
297
|
-
{
|
|
298
|
-
id: 'main_offer',
|
|
299
|
-
name: 'Oferta Principal',
|
|
300
|
-
type: 'main',
|
|
301
|
-
price: 197,
|
|
302
|
-
currency: 'BRL',
|
|
303
|
-
quantity: 1,
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
id: 'order_bump_01',
|
|
307
|
-
name: 'Order Bump Especial',
|
|
308
|
-
type: 'order_bump',
|
|
309
|
-
price: 47,
|
|
310
|
-
currency: 'BRL',
|
|
311
|
-
quantity: 1,
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
id: 'upsell_01',
|
|
315
|
-
name: 'Upsell 01',
|
|
316
|
-
type: 'upsell',
|
|
317
|
-
price: 97,
|
|
318
|
-
currency: 'BRL',
|
|
319
|
-
quantity: 1,
|
|
320
|
-
},
|
|
321
|
-
] },
|
|
322
|
-
checkout: {
|
|
323
|
-
mode: 'single_product',
|
|
324
|
-
selectedItems: [{ productId: "main_offer", quantity: 1 }],
|
|
325
|
-
calculateValueFrom: 'selected_items',
|
|
326
|
-
allowDynamicItems: true,
|
|
327
|
-
},
|
|
328
|
-
mappings: {
|
|
329
|
-
attributes: {
|
|
330
|
-
productId: ['data-product-id', 'data-sku', 'data-offer-id'],
|
|
331
|
-
productName: ['data-product-name', 'data-name'],
|
|
332
|
-
price: ['data-product-price', 'data-price'],
|
|
333
|
-
quantity: ['data-quantity', 'data-qty'],
|
|
334
|
-
currency: ['data-currency'],
|
|
335
|
-
},
|
|
336
|
-
fields: {
|
|
337
|
-
productId: ['productId', 'product_id', 'offerId', 'sku'],
|
|
338
|
-
productName: ['productName', 'product_name'],
|
|
339
|
-
price: ['price', 'amount'],
|
|
340
|
-
quantity: ['quantity', 'qty'],
|
|
341
|
-
currency: ['currency'],
|
|
342
|
-
email: ['email', 'customerEmail'],
|
|
343
|
-
phone: ['phone', 'telefone', 'customerPhone'],
|
|
344
|
-
},
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
367
|
manual: {
|
|
348
368
|
pageView: { enabled: false },
|
|
349
|
-
purchase: { enabled: false },
|
|
350
|
-
lead: { enabled: false },
|
|
369
|
+
purchase: { enabled: false, sources: [] },
|
|
370
|
+
lead: { enabled: false, sources: [] },
|
|
351
371
|
addToCart: { enabled: true },
|
|
352
372
|
removeFromCart: { enabled: true },
|
|
353
|
-
initiateCheckout: { enabled: false },
|
|
354
|
-
addPaymentInfo: { enabled: false },
|
|
355
|
-
search: { enabled: false },
|
|
356
|
-
viewContent: { enabled: false },
|
|
373
|
+
initiateCheckout: { enabled: false, sources: [] },
|
|
374
|
+
addPaymentInfo: { enabled: false, sources: [] },
|
|
375
|
+
search: { enabled: false, sources: [] },
|
|
376
|
+
viewContent: { enabled: false, sources: [] },
|
|
357
377
|
},
|
|
358
378
|
auto: {
|
|
359
379
|
enabled: true,
|
|
360
380
|
detectors: {
|
|
361
|
-
lead: { enabled: false },
|
|
362
|
-
purchase: { enabled: false },
|
|
381
|
+
lead: { enabled: false, sources: [] },
|
|
382
|
+
purchase: { enabled: false, sources: [] },
|
|
363
383
|
addToCart: addToCartDetectorConfig(),
|
|
364
|
-
removeFromCart: { enabled: false },
|
|
365
|
-
initiateCheckout: { enabled: false },
|
|
366
|
-
addPaymentInfo: { enabled: false },
|
|
367
|
-
search: { enabled: false },
|
|
368
|
-
viewContent: { enabled: false },
|
|
384
|
+
removeFromCart: { enabled: false, sources: [] },
|
|
385
|
+
initiateCheckout: { enabled: false, sources: [] },
|
|
386
|
+
addPaymentInfo: { enabled: false, sources: [] },
|
|
387
|
+
search: { enabled: false, sources: [] },
|
|
388
|
+
viewContent: { enabled: false, sources: [] },
|
|
369
389
|
},
|
|
370
390
|
},
|
|
371
391
|
rules: {
|