@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.
- package/CHANGELOG.md +260 -4
- package/README.md +65 -118
- 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/docs/public/README.md +75 -0
- package/docs/public/api/exports.md +47 -0
- package/docs/public/api/pixel.md +65 -0
- package/docs/public/configuration/commerce.md +44 -0
- package/docs/public/configuration/modules.md +66 -0
- package/docs/public/configuration/overview.md +66 -0
- package/docs/public/events/catalog.md +65 -0
- package/docs/public/getting-started/installation.md +75 -0
- package/docs/public/getting-started/quick-start.md +77 -0
- package/docs/public/getting-started/react-nextjs.md +55 -0
- package/docs/public/getting-started/script-tag.md +57 -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 +68 -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 +32 -0
- package/docs/public/privacy/limitations.md +33 -0
- package/docs/public/release-candidate/validation.md +37 -0
- package/docs/public/troubleshooting.md +55 -0
- package/package.json +13 -1
- package/dist/types-CTpRvFKZ.d.ts +0 -71
- package/dist/types-DGlBdsAy.d.mts +0 -71
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { U as UrlContextConfig } from './url-context-BjAsQoVl.js';
|
|
2
|
+
|
|
1
3
|
type MetaBrowserDestinationConfig = {
|
|
2
4
|
enabled: boolean;
|
|
3
5
|
pixelIds: string[];
|
|
@@ -184,12 +186,54 @@ type SelectorFormConfig = string[] | {
|
|
|
184
186
|
};
|
|
185
187
|
|
|
186
188
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
* Runtime: ProductCatalog + CommerceState + Extractors +
|
|
190
|
-
* CommerceResolver + OrderCalculator (Etapas 12C–12F).
|
|
189
|
+
* Contrato de fontes independentes para auto detectors (Etapa 14).
|
|
190
|
+
* Um evento automático pode ter várias sources; cada uma vira um detector.
|
|
191
191
|
*/
|
|
192
|
-
|
|
192
|
+
|
|
193
|
+
type AutoSourceType = 'selector' | 'form' | 'payment' | 'lifecycle' | 'url';
|
|
194
|
+
type AutoSourceBase = {
|
|
195
|
+
name: string;
|
|
196
|
+
type: AutoSourceType;
|
|
197
|
+
enabled?: boolean;
|
|
198
|
+
fireOnce?: boolean;
|
|
199
|
+
debounceMs?: number;
|
|
200
|
+
cooldownMs?: number;
|
|
201
|
+
};
|
|
202
|
+
type SelectorAutoSource = AutoSourceBase & {
|
|
203
|
+
type: 'selector';
|
|
204
|
+
selector: SelectorConfig;
|
|
205
|
+
selectorType?: SelectorType;
|
|
206
|
+
trigger?: 'click' | 'submit';
|
|
207
|
+
};
|
|
208
|
+
type FormAutoSource = AutoSourceBase & {
|
|
209
|
+
type: 'form';
|
|
210
|
+
selectorForm: SelectorFormConfig;
|
|
211
|
+
/** Opcional: restringe a fonte form a um target específico. */
|
|
212
|
+
selector?: SelectorConfig;
|
|
213
|
+
selectorType?: SelectorType;
|
|
214
|
+
};
|
|
215
|
+
type PaymentAutoSource = AutoSourceBase & {
|
|
216
|
+
type: 'payment';
|
|
217
|
+
paymentMethod?: PaymentMethod | (string & {});
|
|
218
|
+
cardDetection?: boolean;
|
|
219
|
+
autoDispatch?: boolean;
|
|
220
|
+
formSelector?: string;
|
|
221
|
+
};
|
|
222
|
+
type LifecycleAutoSource = AutoSourceBase & {
|
|
223
|
+
type: 'lifecycle';
|
|
224
|
+
trigger: 'init' | 'ready';
|
|
225
|
+
};
|
|
226
|
+
type UrlAutoSource = AutoSourceBase & {
|
|
227
|
+
type: 'url';
|
|
228
|
+
patterns: string[];
|
|
229
|
+
};
|
|
230
|
+
type AutoTrackSource = SelectorAutoSource | FormAutoSource | PaymentAutoSource | LifecycleAutoSource | UrlAutoSource;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Contratos globais de commerce (root `PixelConfig.commerce`).
|
|
234
|
+
* Não pertencem a conversion — representam o contexto comercial da página/fluxo.
|
|
235
|
+
*/
|
|
236
|
+
type ProductType = 'main' | 'order_bump' | 'upsell' | 'downsell' | 'cross_sell' | 'addon' | 'subscription' | 'custom' | 'other';
|
|
193
237
|
type CommerceProduct = {
|
|
194
238
|
id: string;
|
|
195
239
|
name?: string;
|
|
@@ -203,7 +247,7 @@ type CommerceProduct = {
|
|
|
203
247
|
brand?: string;
|
|
204
248
|
metadata?: Record<string, unknown>;
|
|
205
249
|
};
|
|
206
|
-
type
|
|
250
|
+
type CommerceCartItem = {
|
|
207
251
|
productId: string;
|
|
208
252
|
quantity?: number;
|
|
209
253
|
price?: number;
|
|
@@ -211,36 +255,76 @@ type CommerceItem = {
|
|
|
211
255
|
selected?: boolean;
|
|
212
256
|
metadata?: Record<string, unknown>;
|
|
213
257
|
};
|
|
214
|
-
type
|
|
215
|
-
type CommerceCalculateValueFrom = '
|
|
258
|
+
type CommerceCartMode = 'landing_page' | 'single_product' | 'multi_product' | 'checkout' | 'upsell' | 'custom' | 'cart' | 'funnel';
|
|
259
|
+
type CommerceCalculateValueFrom = 'cart' | 'event' | 'manual' | 'catalog';
|
|
260
|
+
type CommerceEnrichmentSource = 'cart' | 'event' | 'event_or_cart' | 'catalog';
|
|
261
|
+
type CommerceEventEnrichmentConfig = {
|
|
262
|
+
enabled: boolean;
|
|
263
|
+
source?: CommerceEnrichmentSource;
|
|
264
|
+
};
|
|
265
|
+
type CommerceEnrichmentConfig = {
|
|
266
|
+
pageView?: CommerceEventEnrichmentConfig;
|
|
267
|
+
viewContent?: CommerceEventEnrichmentConfig;
|
|
268
|
+
lead?: CommerceEventEnrichmentConfig;
|
|
269
|
+
addToCart?: CommerceEventEnrichmentConfig;
|
|
270
|
+
removeFromCart?: CommerceEventEnrichmentConfig;
|
|
271
|
+
initiateCheckout?: CommerceEventEnrichmentConfig;
|
|
272
|
+
addPaymentInfo?: CommerceEventEnrichmentConfig;
|
|
273
|
+
purchase?: CommerceEventEnrichmentConfig;
|
|
274
|
+
};
|
|
275
|
+
type ProductCatalogConfig = {
|
|
276
|
+
products?: CommerceProduct[];
|
|
277
|
+
};
|
|
278
|
+
type CommerceCartConfig = {
|
|
279
|
+
mode?: CommerceCartMode;
|
|
280
|
+
/** Seed inicial do carrinho — não é estado vivo. */
|
|
281
|
+
initialItems?: CommerceCartItem[];
|
|
282
|
+
allowDynamicItems?: boolean;
|
|
283
|
+
calculateValueFrom?: CommerceCalculateValueFrom;
|
|
284
|
+
metadata?: Record<string, unknown>;
|
|
285
|
+
};
|
|
286
|
+
type CommerceMappingsConfig = {
|
|
287
|
+
attributes?: Record<string, string[]>;
|
|
288
|
+
fields?: Record<string, string[]>;
|
|
289
|
+
};
|
|
216
290
|
type CommerceConfig = {
|
|
291
|
+
enabled?: boolean;
|
|
217
292
|
currency?: string;
|
|
218
|
-
catalog?:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
mode?: CommerceCheckoutMode;
|
|
223
|
-
selectedItems?: CommerceItem[];
|
|
224
|
-
calculateValueFrom?: CommerceCalculateValueFrom;
|
|
225
|
-
allowDynamicItems?: boolean;
|
|
226
|
-
};
|
|
227
|
-
mappings?: {
|
|
228
|
-
attributes?: Record<string, string[]>;
|
|
229
|
-
fields?: Record<string, string[]>;
|
|
230
|
-
};
|
|
293
|
+
catalog?: ProductCatalogConfig;
|
|
294
|
+
cart?: CommerceCartConfig;
|
|
295
|
+
mappings?: CommerceMappingsConfig;
|
|
296
|
+
enrichment?: CommerceEnrichmentConfig;
|
|
231
297
|
};
|
|
232
|
-
|
|
298
|
+
declare const DEFAULT_COMMERCE_ENRICHMENT: Required<CommerceEnrichmentConfig>;
|
|
299
|
+
/** Default seguro: commerce off, sem produtos, sem itens. */
|
|
233
300
|
declare const DEFAULT_COMMERCE_CONFIG: CommerceConfig;
|
|
301
|
+
/** Normaliza calculateValueFrom (inclui aliases legado em runtime). */
|
|
302
|
+
declare function normalizeCalculateValueFrom(value: CommerceCalculateValueFrom | string | undefined): 'cart' | 'event' | 'manual' | 'catalog';
|
|
234
303
|
|
|
304
|
+
/** Limites de nível do Engagement Runtime (Etapa 19). */
|
|
235
305
|
type EngagementThresholds = {
|
|
236
|
-
low
|
|
237
|
-
|
|
306
|
+
/** Score máximo (inclusive) do nível `low`. */
|
|
307
|
+
lowMax: number;
|
|
308
|
+
/** Score máximo (inclusive) do nível `medium`. */
|
|
309
|
+
mediumMax: number;
|
|
238
310
|
};
|
|
239
311
|
|
|
312
|
+
/** Pesos positivos do Engagement Runtime (Etapa 19). */
|
|
240
313
|
type EngagementWeights = {
|
|
314
|
+
activeTime: number;
|
|
241
315
|
scroll: number;
|
|
242
316
|
click: number;
|
|
243
|
-
|
|
317
|
+
viewport: number;
|
|
318
|
+
visibility: number;
|
|
319
|
+
heartbeat: number;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/** Penalidades do Engagement Runtime (Etapa 19). */
|
|
323
|
+
type EngagementPenalties = {
|
|
324
|
+
/** Penalidade proporcional ao tempo ocioso (0..1). */
|
|
325
|
+
idle: number;
|
|
326
|
+
/** Penalidade proporcional a rage clicks (0..1). */
|
|
327
|
+
rageClick: number;
|
|
244
328
|
};
|
|
245
329
|
|
|
246
330
|
type ScrollBehaviorConfig = {
|
|
@@ -266,24 +350,129 @@ type VisibilityBehaviorConfig = {
|
|
|
266
350
|
type ExitIntentBehaviorConfig = {
|
|
267
351
|
enabled: boolean;
|
|
268
352
|
};
|
|
353
|
+
/**
|
|
354
|
+
* Alvo observado pelo ViewportTracker (Etapa 18).
|
|
355
|
+
* `key` deve ser único dentro de `targets`.
|
|
356
|
+
*/
|
|
357
|
+
type ViewportTargetConfig = {
|
|
358
|
+
readonly key: string;
|
|
359
|
+
/** Seletor CSS oficial. */
|
|
360
|
+
readonly selector: string;
|
|
361
|
+
/** Ratio mínimo para confirmar entrada (0..1). Default 0.5. */
|
|
362
|
+
readonly enterThreshold?: number;
|
|
363
|
+
/** Ratio no qual sai (0..enterThreshold). Default 0. */
|
|
364
|
+
readonly exitThreshold?: number;
|
|
365
|
+
/** Tempo mínimo contínuo acima do enterThreshold. Default 0. */
|
|
366
|
+
readonly minVisibleMs?: number;
|
|
367
|
+
/** Emite VIEWPORT_EXIT após entrada. Default true. */
|
|
368
|
+
readonly trackExit?: boolean;
|
|
369
|
+
/** Um único ciclo válido por elemento. Default false. */
|
|
370
|
+
readonly once?: boolean;
|
|
371
|
+
/** Inclui descritor sanitizado do elemento. Default false. */
|
|
372
|
+
readonly includeElement?: boolean;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* Viewport Tracker — contrato oficial em `trackers.viewport`.
|
|
376
|
+
*/
|
|
269
377
|
type ViewportBehaviorConfig = {
|
|
270
|
-
enabled: boolean;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
378
|
+
readonly enabled: boolean;
|
|
379
|
+
readonly targets: readonly ViewportTargetConfig[];
|
|
380
|
+
readonly rootMargin: string;
|
|
381
|
+
readonly observeMutations: boolean;
|
|
382
|
+
readonly mutationDebounceMs: number;
|
|
383
|
+
readonly maxObservedElements: number;
|
|
274
384
|
};
|
|
275
|
-
|
|
385
|
+
/**
|
|
386
|
+
* Heartbeat Runtime Engine (único contrato oficial).
|
|
387
|
+
* Não faz parte de `trackers`.
|
|
388
|
+
*/
|
|
389
|
+
type HeartbeatModuleConfig = {
|
|
276
390
|
enabled: boolean;
|
|
277
391
|
intervalMs: number;
|
|
278
392
|
hiddenIntervalMs: number;
|
|
393
|
+
emitWhenHidden: boolean;
|
|
394
|
+
emitWhenIdle: boolean;
|
|
395
|
+
includeSnapshot: boolean;
|
|
396
|
+
fireImmediately: boolean;
|
|
397
|
+
minActivityWindowMs?: number;
|
|
279
398
|
};
|
|
399
|
+
/**
|
|
400
|
+
* Engagement Runtime Engine (Etapa 19) — contrato oficial em
|
|
401
|
+
* `modules.behavior.engagement`. Não faz parte de `trackers`.
|
|
402
|
+
*/
|
|
280
403
|
type EngagementBehaviorConfig = {
|
|
281
404
|
enabled: boolean;
|
|
405
|
+
/** Intervalo de avaliação periódica via ManagedScheduler. */
|
|
406
|
+
evaluationIntervalMs: number;
|
|
407
|
+
/** Emite ENGAGEMENT_UPDATE apenas quando o score muda o suficiente. */
|
|
408
|
+
emitOnChange: boolean;
|
|
409
|
+
/** Delta mínimo de score para emitir um novo ENGAGEMENT_UPDATE. */
|
|
410
|
+
minScoreDelta: number;
|
|
411
|
+
/** Emite ENGAGEMENT_SUMMARY (uma vez) no destroy. */
|
|
412
|
+
emitSummaryOnDestroy: boolean;
|
|
282
413
|
weights: EngagementWeights;
|
|
414
|
+
penalties: EngagementPenalties;
|
|
283
415
|
thresholds: EngagementThresholds;
|
|
284
416
|
};
|
|
417
|
+
/**
|
|
418
|
+
* Behavior Rate Limiter (Etapa 20) — limitador interno por instância.
|
|
419
|
+
* Protege o runtime de bursts de sinais; não é rate limit de Transport.
|
|
420
|
+
*/
|
|
421
|
+
type RateLimitBehaviorConfig = {
|
|
422
|
+
enabled: boolean;
|
|
423
|
+
/** Janela deslizante (ms). */
|
|
424
|
+
windowMs: number;
|
|
425
|
+
/** Máximo de sinais aceitos por janela. */
|
|
426
|
+
maxSignalsPerWindow: number;
|
|
427
|
+
/** Sinais críticos (IDLE/ACTIVITY/VISIBLE/HIDDEN/EXIT_INTENT) ignoram o limite. */
|
|
428
|
+
criticalBypass: boolean;
|
|
429
|
+
};
|
|
430
|
+
/** Estratégia de descarte quando o buffer atinge `maxSize`. */
|
|
431
|
+
type BufferDropStrategy = 'drop_oldest' | 'drop_newest' | 'compress_similar';
|
|
432
|
+
/**
|
|
433
|
+
* Behavior Buffer (Etapa 20) — agregação interna de sinais normalizados.
|
|
434
|
+
* NÃO é a Transport Queue: sem persistência, retry, batch HTTP ou sendBeacon.
|
|
435
|
+
*/
|
|
436
|
+
type BufferBehaviorConfig = {
|
|
437
|
+
enabled: boolean;
|
|
438
|
+
/** Capacidade máxima de entries antes de aplicar a drop strategy. */
|
|
439
|
+
maxSize: number;
|
|
440
|
+
/** Idade máxima (ms) de um entry antes do flush por idade (0 = desabilitado). */
|
|
441
|
+
maxAgeMs: number;
|
|
442
|
+
/** Tamanho que dispara flush por tamanho. */
|
|
443
|
+
flushSize: number;
|
|
444
|
+
dropStrategy: BufferDropStrategy;
|
|
445
|
+
/** Flush automático quando a página fica hidden. */
|
|
446
|
+
flushOnHidden: boolean;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* Behavior State Machine (Etapa 20) — estado do runtime por instância.
|
|
450
|
+
*/
|
|
451
|
+
type StateMachineBehaviorConfig = {
|
|
452
|
+
enabled: boolean;
|
|
453
|
+
/** Tamanho máximo do histórico de transições retido. */
|
|
454
|
+
historyLimit: number;
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Behavior Session Summary (Etapa 20) — resumo consolidado da sessão.
|
|
458
|
+
*/
|
|
459
|
+
type SessionSummaryBehaviorConfig = {
|
|
460
|
+
enabled: boolean;
|
|
461
|
+
/** Emite BEHAVIOR_SESSION_SUMMARY quando a página fica hidden. */
|
|
462
|
+
emitOnHidden: boolean;
|
|
463
|
+
/** Emite BEHAVIOR_SESSION_SUMMARY no destroy. */
|
|
464
|
+
emitOnDestroy: boolean;
|
|
465
|
+
/** Duração mínima da sessão (ms) para emitir o summary. */
|
|
466
|
+
minimumSessionMs: number;
|
|
467
|
+
};
|
|
285
468
|
type BehaviorModuleConfig = {
|
|
286
469
|
enabled: boolean;
|
|
470
|
+
heartbeat: HeartbeatModuleConfig;
|
|
471
|
+
engagement: EngagementBehaviorConfig;
|
|
472
|
+
rateLimit: RateLimitBehaviorConfig;
|
|
473
|
+
buffer: BufferBehaviorConfig;
|
|
474
|
+
stateMachine: StateMachineBehaviorConfig;
|
|
475
|
+
sessionSummary: SessionSummaryBehaviorConfig;
|
|
287
476
|
trackers: {
|
|
288
477
|
scroll: ScrollBehaviorConfig;
|
|
289
478
|
click: ClickBehaviorConfig;
|
|
@@ -291,8 +480,6 @@ type BehaviorModuleConfig = {
|
|
|
291
480
|
visibility: VisibilityBehaviorConfig;
|
|
292
481
|
exitIntent: ExitIntentBehaviorConfig;
|
|
293
482
|
viewport: ViewportBehaviorConfig;
|
|
294
|
-
heartbeat: HeartbeatBehaviorConfig;
|
|
295
|
-
engagement: EngagementBehaviorConfig;
|
|
296
483
|
};
|
|
297
484
|
};
|
|
298
485
|
|
|
@@ -311,46 +498,33 @@ type ManualConversionConfig = {
|
|
|
311
498
|
viewContent: ManualEventConfig;
|
|
312
499
|
};
|
|
313
500
|
/**
|
|
314
|
-
*
|
|
315
|
-
* `selectorType` é fallback para strings sem prefixo (DEFAULT_SELECTOR_TYPE = css).
|
|
501
|
+
* Config de um auto detector — fontes independentes em `sources[]`.
|
|
316
502
|
*/
|
|
317
|
-
type
|
|
318
|
-
enabled: boolean;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
type
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
type
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
paymentMethod: PaymentMethod;
|
|
339
|
-
cardDetection: boolean;
|
|
340
|
-
autoDispatch: boolean;
|
|
503
|
+
type AutoDetectorConfig = {
|
|
504
|
+
enabled: boolean;
|
|
505
|
+
sources: AutoTrackSource[];
|
|
506
|
+
};
|
|
507
|
+
type LeadAutoDetectorConfig = AutoDetectorConfig;
|
|
508
|
+
type AddToCartAutoDetectorConfig = AutoDetectorConfig;
|
|
509
|
+
type InitiateCheckoutAutoDetectorConfig = AutoDetectorConfig;
|
|
510
|
+
type PurchaseAutoDetectorConfig = AutoDetectorConfig;
|
|
511
|
+
type RemoveFromCartAutoDetectorConfig = AutoDetectorConfig;
|
|
512
|
+
type SearchAutoDetectorConfig = AutoDetectorConfig;
|
|
513
|
+
type ViewContentAutoDetectorConfig = AutoDetectorConfig;
|
|
514
|
+
type AddPaymentInfoAutoDetectorConfig = AutoDetectorConfig;
|
|
515
|
+
type ConversionAutoDetectorsConfig = {
|
|
516
|
+
lead: AutoDetectorConfig;
|
|
517
|
+
addToCart: AutoDetectorConfig;
|
|
518
|
+
removeFromCart: AutoDetectorConfig;
|
|
519
|
+
initiateCheckout: AutoDetectorConfig;
|
|
520
|
+
purchase: AutoDetectorConfig;
|
|
521
|
+
addPaymentInfo: AutoDetectorConfig;
|
|
522
|
+
search: AutoDetectorConfig;
|
|
523
|
+
viewContent: AutoDetectorConfig;
|
|
341
524
|
};
|
|
342
525
|
type AutoConversionConfig = {
|
|
343
526
|
enabled: boolean;
|
|
344
|
-
detectors:
|
|
345
|
-
lead: LeadAutoDetectorConfig;
|
|
346
|
-
purchase: PurchaseAutoDetectorConfig;
|
|
347
|
-
addToCart: AddToCartAutoDetectorConfig;
|
|
348
|
-
removeFromCart: RemoveFromCartAutoDetectorConfig;
|
|
349
|
-
initiateCheckout: InitiateCheckoutAutoDetectorConfig;
|
|
350
|
-
addPaymentInfo: AddPaymentInfoAutoDetectorConfig;
|
|
351
|
-
search: SearchAutoDetectorConfig;
|
|
352
|
-
viewContent: ViewContentAutoDetectorConfig;
|
|
353
|
-
};
|
|
527
|
+
detectors: ConversionAutoDetectorsConfig;
|
|
354
528
|
};
|
|
355
529
|
type ConversionRulesConfig = {
|
|
356
530
|
enabled: boolean;
|
|
@@ -366,12 +540,10 @@ type ConversionRulesConfig = {
|
|
|
366
540
|
};
|
|
367
541
|
/**
|
|
368
542
|
* Config do módulo de conversion.
|
|
369
|
-
*
|
|
543
|
+
* Commerce é root (`PixelConfig.commerce`) — não vive aqui.
|
|
370
544
|
*/
|
|
371
545
|
type ConversionModuleConfig = {
|
|
372
546
|
enabled: boolean;
|
|
373
|
-
/** Catálogo, checkout inicial e mappings — compartilhado por manual e auto. */
|
|
374
|
-
commerce: CommerceConfig;
|
|
375
547
|
manual: ManualConversionConfig;
|
|
376
548
|
auto: AutoConversionConfig;
|
|
377
549
|
rules: ConversionRulesConfig;
|
|
@@ -427,6 +599,8 @@ type CoreModuleConfig = {
|
|
|
427
599
|
dedupe: DedupeConfig;
|
|
428
600
|
coordination: CoordinationConfig;
|
|
429
601
|
ordering: OrderingConfig;
|
|
602
|
+
/** Core UrlContext — off por default. */
|
|
603
|
+
urlContext?: UrlContextConfig;
|
|
430
604
|
};
|
|
431
605
|
|
|
432
606
|
type PrivacyConsentConfig = {
|
|
@@ -549,7 +723,9 @@ type PixelConfig = {
|
|
|
549
723
|
transport: TransportConfig;
|
|
550
724
|
storage: StorageConfig;
|
|
551
725
|
attribution: AttributionConfig;
|
|
726
|
+
/** Contexto comercial global da página/fluxo (fora dos módulos). */
|
|
727
|
+
commerce: CommerceConfig;
|
|
552
728
|
modules: ModulesConfig;
|
|
553
729
|
};
|
|
554
730
|
|
|
555
|
-
export {
|
|
731
|
+
export { DEFAULT_COMMERCE_CONFIG as $, type AttributionStoragePersistence as A, type BehaviorModuleConfig as B, type ConversionModuleConfig as C, type SelectorFormTrigger as D, type EngagementThresholds as E, type FingerprintMode as F, type CommerceCalculateValueFrom as G, type CommerceCartConfig as H, type IntegrationsModuleConfig as I, type CommerceCartItem as J, type CommerceCartMode as K, type LifecycleAutoSource as L, type CommerceConfig as M, type CommerceEnrichmentConfig as N, type CommerceEnrichmentSource as O, type PixelConfig as P, type QueueStoragePersistence as Q, type CommerceEventEnrichmentConfig as R, type SessionStoragePersistence as S, type TransportModuleConfig as T, type CommerceMappingsConfig as U, type VisitorStoragePersistence as V, type CommerceProduct as W, type ProductCatalogConfig as X, type ProductType as Y, type UrlAutoSource as Z, DEFAULT_SELECTOR_TYPE as _, type AttributionConfig as a, DEFAULT_COMMERCE_ENRICHMENT as a0, getPrimarySelectorValue as a1, normalizeCalculateValueFrom as a2, resolveSelectorTypeFallback as a3, type AddPaymentInfoAutoDetectorConfig as a4, type AddToCartAutoDetectorConfig as a5, type AnonymizationConfig as a6, type AutoConversionConfig as a7, type AutoDetectorConfig as a8, type ClickBehaviorConfig as a9, type RemoveFromCartAutoDetectorConfig as aA, type ScrollBehaviorConfig as aB, type SearchAutoDetectorConfig as aC, type SessionConfig as aD, type TransportBatchConfig as aE, type TransportFlushConfig as aF, type TransportOfflineConfig as aG, type TransportRetryConfig as aH, type TransportTimeoutConfig as aI, type ViewContentAutoDetectorConfig as aJ, type ViewportBehaviorConfig as aK, type ViewportTargetConfig as aL, type VisibilityBehaviorConfig as aM, type VisitorConfig as aN, type ConsentConfig as aa, type ConversionAutoDetectorsConfig as ab, type ConversionRulesConfig as ac, type CoordinationConfig as ad, type DedupeConfig as ae, type EngagementBehaviorConfig as af, type ExitIntentBehaviorConfig as ag, type FingerprintConfig as ah, type GoogleBrowserDestinationConfig as ai, type GoogleIntegrationConfig as aj, type HeartbeatModuleConfig as ak, type IdleBehaviorConfig as al, type InitiateCheckoutAutoDetectorConfig as am, type IntegrationTestDestinationConfig as an, type LeadAutoDetectorConfig as ao, type ManualConversionConfig as ap, type ManualEventConfig as aq, type MetaBrowserDestinationConfig as ar, type MetaIntegrationConfig as as, type ModulesConfig as at, type TikTokBrowserDestinationConfig as au, type OrderingConfig as av, type PageViewConfig as aw, type PiiConfig as ax, type PrivacyConsentConfig as ay, type PurchaseAutoDetectorConfig as az, type CoreModuleConfig as b, type PrivacyModuleConfig as c, type AppConfig as d, type PixelEnvironment as e, type PixelSource as f, type PixelTarget as g, type IdentityConfig as h, type TransportConfig as i, type StorageConfig as j, type StorageKeysConfig as k, type AutoSourceBase as l, type AutoSourceType as m, type AutoTrackSource as n, type EngagementWeights as o, type EngagementPenalties as p, type FormAutoSource as q, type PaymentAutoSource as r, type PaymentMethod as s, type SelectorAutoSource as t, type SelectorConfig as u, type SelectorDescriptor as v, type SelectorInput as w, type SelectorType as x, type SelectorFormConfig as y, type SelectorFormMode as z };
|