@aranova/tracking-react 0.17.2 → 0.18.0
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/README.md +39 -20
- package/dist/index.d.mts +175 -12
- package/dist/index.d.ts +175 -12
- package/dist/index.js +555 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +552 -64
- package/dist/index.mjs.map +1 -1
- package/dist/phone.js +90 -0
- package/dist/phone.js.map +1 -1
- package/dist/phone.mjs +90 -0
- package/dist/phone.mjs.map +1 -1
- package/dist/{sales-C3jFBx08.d.mts → sales-QqKh6_iy.d.mts} +55 -2
- package/dist/{sales-C3jFBx08.d.ts → sales-QqKh6_iy.d.ts} +55 -2
- package/dist/sales.d.mts +1 -1
- package/dist/sales.d.ts +1 -1
- package/dist/sales.js +16 -0
- package/dist/sales.js.map +1 -1
- package/dist/sales.mjs +16 -0
- package/dist/sales.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,10 +15,12 @@ Create one shared tracking module and import the scoped `TrackingProvider` / `us
|
|
|
15
15
|
```ts
|
|
16
16
|
// src/lib/tracking.ts
|
|
17
17
|
import { createTracking } from "@aranova/tracking-react";
|
|
18
|
+
import { ARANOVA_TRACKING_CONFIG } from "./aranova-services";
|
|
18
19
|
|
|
19
20
|
export const { TrackingProvider, useTracking } = createTracking({
|
|
20
21
|
apiKey: import.meta.env.VITE_ARANOVA_TRACKING_API_KEY,
|
|
21
22
|
endpoint: import.meta.env.VITE_ARANOVA_TRACKING_ENDPOINT,
|
|
23
|
+
trackingConfig: ARANOVA_TRACKING_CONFIG,
|
|
22
24
|
triggers: {
|
|
23
25
|
automatic: {
|
|
24
26
|
page_view: {},
|
|
@@ -46,17 +48,18 @@ import { App } from "./App";
|
|
|
46
48
|
import { TrackingProvider } from "./lib/tracking";
|
|
47
49
|
|
|
48
50
|
createRoot(document.getElementById("root")!).render(
|
|
49
|
-
<TrackingProvider
|
|
51
|
+
<TrackingProvider>
|
|
50
52
|
<App />
|
|
51
53
|
</TrackingProvider>,
|
|
52
54
|
);
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
###
|
|
57
|
+
### Legacy static gtag IDs
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
`gtagId`, `gtagIds`, `GoogleAdsTracking`, and generated `ARANOVA_GTAG_IDS` remain
|
|
60
|
+
compatibility APIs. Do not use them for new installs: static IDs cannot consume dashboard
|
|
61
|
+
tag changes or tombstones without a redeploy. If maintaining a legacy install, `gtagIds`
|
|
62
|
+
loads every entry and takes precedence over `gtagId`.
|
|
60
63
|
|
|
61
64
|
```tsx
|
|
62
65
|
<TrackingProvider gtagIds={{ production: "AW-111111111", test: "AW-222222222" }}>
|
|
@@ -274,32 +277,39 @@ and the CLI reference: [cli.md](https://github.com/AranovaIO/aranova_internal/bl
|
|
|
274
277
|
|
|
275
278
|
## On-site conversion firing
|
|
276
279
|
|
|
277
|
-
|
|
280
|
+
Run `tracking-cli gen` once to emit `ARANOVA_TRACKING_CONFIG`, then use that
|
|
281
|
+
reference everywhere Google tracking is initialized. R2 is authoritative: the SDK confirms
|
|
282
|
+
the current object before emitting Google tag, page-view, or conversion commands. Dashboard
|
|
283
|
+
tag changes, goal remaps, and disabled-state tombstones propagate under
|
|
284
|
+
`public, max-age=60, must-revalidate` with no CLI run or site redeploy.
|
|
278
285
|
|
|
279
286
|
```ts
|
|
280
|
-
import {
|
|
281
|
-
|
|
287
|
+
import {
|
|
288
|
+
createSalesClient,
|
|
289
|
+
createTracking,
|
|
290
|
+
getTrackingConfigRuntime,
|
|
291
|
+
toMinor,
|
|
292
|
+
} from "@aranova/tracking-react";
|
|
293
|
+
import {
|
|
294
|
+
ARANOVA_TRACKING_CONFIG,
|
|
295
|
+
type AranovaConversion,
|
|
296
|
+
type AranovaService,
|
|
297
|
+
} from "./aranova-services";
|
|
298
|
+
|
|
299
|
+
const googleTracking = getTrackingConfigRuntime(ARANOVA_TRACKING_CONFIG);
|
|
282
300
|
|
|
283
301
|
export const { TrackingProvider, useTracking } = createTracking({
|
|
284
302
|
apiKey,
|
|
285
303
|
endpoint,
|
|
286
304
|
triggers,
|
|
287
|
-
|
|
305
|
+
trackingConfig: ARANOVA_TRACKING_CONFIG,
|
|
288
306
|
});
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
- **Automatic event-goals** (scroll depth, time-on-site, page views, multi-page, form-start) fire **themselves** when their detector crosses the published threshold — zero extra code.
|
|
292
|
-
- **Sales + manual events** fire through the sales client. Give it the same config:
|
|
293
|
-
|
|
294
|
-
```ts
|
|
295
|
-
import { createSalesClient, resolveConversionConfig, toMinor } from "@aranova/tracking-react";
|
|
296
|
-
import type { AranovaService, AranovaConversion } from "./aranova-services"; // generated by `gen`
|
|
297
307
|
|
|
298
308
|
// Bind the generated unions so `service` and `trackConversion` keys are type-checked.
|
|
299
309
|
const sales = createSalesClient<AranovaService, AranovaConversion>({
|
|
300
310
|
apiKey,
|
|
301
311
|
endpoint,
|
|
302
|
-
firing:
|
|
312
|
+
firing: googleTracking,
|
|
303
313
|
});
|
|
304
314
|
|
|
305
315
|
await sales.recordSale({
|
|
@@ -309,6 +319,10 @@ await sales.recordSale({
|
|
|
309
319
|
}); // records + fires
|
|
310
320
|
```
|
|
311
321
|
|
|
322
|
+
- **Automatic event-goals** fire when their registered detector crosses the published threshold.
|
|
323
|
+
- **Sales + manual goals** use the shared runtime above. Firing is consent-gated,
|
|
324
|
+
transaction-deduped, and browser-only.
|
|
325
|
+
|
|
312
326
|
**Manual conversions (multiple forms):** register the trigger once, then call `trackConversion(key)` in each form's submit handler. Keys come from the dashboard Goals tab (event-goals with a `form_submit`/`phone_click`/`cta_click` trigger mapped to a WEBPAGE action) and are emitted as the `AranovaConversion` union by `gen` — so they autocomplete and reject typos:
|
|
313
327
|
|
|
314
328
|
```ts
|
|
@@ -321,7 +335,12 @@ sales.trackConversion("demo_request");
|
|
|
321
335
|
sales.trackConversion("typo"); // ❌ compile error — not a known goal key
|
|
322
336
|
```
|
|
323
337
|
|
|
324
|
-
Each call fires **only** the WEBPAGE conversion for that goal (no `/sales` write); the SDK
|
|
338
|
+
Each call fires **only** the WEBPAGE conversion for that goal (no `/sales` write); the SDK
|
|
339
|
+
no-ops if the goal isn't mapped. Remapping an existing key needs no codegen. A **new manual
|
|
340
|
+
goal key** still requires `tracking-cli gen` to refresh `AranovaConversion`, plus site handler
|
|
341
|
+
wiring. `ARANOVA_CONFIG_URL` and `conversionConfig: { cdnUrl }` remain legacy compatibility
|
|
342
|
+
APIs; do not use them for new installs. See
|
|
343
|
+
[conversion-config-schema.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/conversion-config-schema.md).
|
|
325
344
|
|
|
326
345
|
> **Before any manual goal exists,** `gen` emits an empty `ARANOVA_CONVERSIONS`, so `AranovaConversion` resolves to `never` — binding it (`createSalesClient<AranovaService, AranovaConversion>`) then makes **every** `trackConversion` call a compile error. Until you've mapped at least one manual goal and re-run `gen`, bind only the service generic (`createSalesClient<AranovaService>(…)`); the conversion key defaults back to `string`.
|
|
327
346
|
|
|
@@ -359,7 +378,7 @@ For non-component contexts the same primitives are exported as plain functions:
|
|
|
359
378
|
|
|
360
379
|
- `createTracking()`
|
|
361
380
|
- `TrackingProvider` and scoped `useTracking`
|
|
362
|
-
- `GoogleAdsTracking`
|
|
381
|
+
- `AdPlatformTracking` and `getTrackingConfigRuntime`; legacy `GoogleAdsTracking`
|
|
363
382
|
- Consent (v2): `useCookiePreferences()` + `UseCookiePreferencesResult`; standalone `optIn()`, `optOut()`, `resetConsent()`, `getConsentChoice()`, `onConsentChange()`, `getConsentState()`, `setConsentState()`
|
|
364
383
|
- Deprecated consent shims: `ConsentBanner` + `ConsentBannerProps`, `useConsent()` + `UseConsentResult`, `useConsentState()`
|
|
365
384
|
- Attribution hooks: `useTrackingParams()`, `useGclid()`
|
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
|
|
3
3
|
import { T as TrackingParams, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, d as TrackingEventCreatePayload, e as TrackingSessionUpsertPayload, F as FormSubmitConfig, f as FormSubmitMetadata, G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, C as ConsentState, g as ConsentChoiceState, h as ConsentSource, P as PhoneConfig, i as ParsedPhone, j as PhoneDisplayFormat } from './phone-utils-DlAQK-gU.mjs';
|
|
4
4
|
export { k as ConsentChoice, D as DEFAULT_DECLINE_TTL_DAYS, l as DEFAULT_PHONE_COUNTRY, J as JsonValue, S as SetConsentOptions, m as TrackedField, n as TrackingInitConfig, o as formSubmitConfigSchema, p as formSubmitMetadataSchema, q as formatPhone, r as formatPhoneAsTyped, s as getConsentChoice, t as getConsentState, u as jsonValueSchema, v as onConsentChange, w as optIn, x as optOut, y as parsePhone, z as phoneField, A as resetConsent, B as setConsentState, E as toE164 } from './phone-utils-DlAQK-gU.mjs';
|
|
5
|
-
import { C as ConversionConfig } from './sales-
|
|
6
|
-
export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, c as CompareTo, d as ConversionConfigStore, e as CurrencyRevenue, f as CustomerCurrencyDelta, g as CustomerCurrencyTotal, h as CustomerGetOptions, i as CustomerGetResult, j as CustomerKpis, k as CustomerKpisDeltas, l as CustomerKpisPrevious, m as CustomerListPage, n as CustomerListQuery, o as CustomerProfile, p as CustomerSegment, q as CustomerSegmentCount, r as CustomerSortField, s as CustomerSummary, t as CustomerSummaryQuery, D as DistinctCustomersByCurrency, G as Granularity, N as NAMED_RANGES, u as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, v as Sale, w as SaleCursorPage, x as SaleFilters, y as SaleInput, z as SaleItem, E as SaleItemInput, F as SaleKeysetSortField, H as SaleListPage, I as SaleListQuery, J as SaleListQueryV2, K as SaleService, L as SaleServiceInput, M as SaleSortField, O as SaleSortOrder, Q as SaleSummary, R as SaleSummaryPrevious,
|
|
5
|
+
import { T as TrackingConfigReference, C as ConversionConfig } from './sales-QqKh6_iy.mjs';
|
|
6
|
+
export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, c as CompareTo, d as ConversionConfigStore, e as CurrencyRevenue, f as CustomerCurrencyDelta, g as CustomerCurrencyTotal, h as CustomerGetOptions, i as CustomerGetResult, j as CustomerKpis, k as CustomerKpisDeltas, l as CustomerKpisPrevious, m as CustomerListPage, n as CustomerListQuery, o as CustomerProfile, p as CustomerSegment, q as CustomerSegmentCount, r as CustomerSortField, s as CustomerSummary, t as CustomerSummaryQuery, D as DistinctCustomersByCurrency, G as Granularity, N as NAMED_RANGES, u as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, v as Sale, w as SaleCursorPage, x as SaleFilters, y as SaleInput, z as SaleItem, E as SaleItemInput, F as SaleKeysetSortField, H as SaleListPage, I as SaleListQuery, J as SaleListQueryV2, K as SaleService, L as SaleServiceInput, M as SaleSortField, O as SaleSortOrder, Q as SaleSummary, R as SaleSummaryPrevious, U as SaleSummaryQuery, V as SaleSummaryQueryV2, W as SaleSummaryV2, X as SaleUpdateInput, Y as SalesBusinessClient, Z as SalesCategoryBreakdown, _ as SalesClient, $ as SalesClientConfig, a0 as SalesCustomersClient, a1 as SalesServiceBreakdown, a2 as SalesTransportConfig, a3 as SalesTrendPoint, a4 as SummaryCurrencyDelta, a5 as SummaryDeltas, a6 as SummaryWindow, a7 as SupportedCurrency, a8 as TRACKING_RANGES, a9 as TrackingOverviewRange, aa as createSalesClient, ab as fetchServices, ac as formatDateInTz, ad as formatMoney, ae as fromMinor, af as getTrackingConfigRuntime, ag as resolveConversionConfig, ah as saleCreateSchema, ai as saleItemSchema, aj as saleServiceSchema, ak as saleUpdateSchema, al as salesRequest, am as toMinor } from './sales-QqKh6_iy.mjs';
|
|
7
7
|
import * as src from 'src';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { CountryCode } from 'libphonenumber-js';
|
|
@@ -135,8 +135,8 @@ declare const ctaClickMetadataSchema: z.ZodObject<{
|
|
|
135
135
|
};
|
|
136
136
|
cta_name: string;
|
|
137
137
|
section?: string | null | undefined;
|
|
138
|
-
destination_url?: string | null | undefined;
|
|
139
138
|
href?: string | null | undefined;
|
|
139
|
+
destination_url?: string | null | undefined;
|
|
140
140
|
element?: string | null | undefined;
|
|
141
141
|
}, {
|
|
142
142
|
page: {
|
|
@@ -144,8 +144,8 @@ declare const ctaClickMetadataSchema: z.ZodObject<{
|
|
|
144
144
|
};
|
|
145
145
|
cta_name: string;
|
|
146
146
|
section?: string | null | undefined;
|
|
147
|
-
destination_url?: string | null | undefined;
|
|
148
147
|
href?: string | null | undefined;
|
|
148
|
+
destination_url?: string | null | undefined;
|
|
149
149
|
element?: string | null | undefined;
|
|
150
150
|
}>;
|
|
151
151
|
type CtaClickMetadata = z.infer<typeof ctaClickMetadataSchema>;
|
|
@@ -349,6 +349,7 @@ type MultiPageSessionConfig = z.infer<typeof multiPageSessionConfigSchema>;
|
|
|
349
349
|
declare const pageExitMetadataSchema: z.ZodObject<{
|
|
350
350
|
dwell_ms: z.ZodNumber;
|
|
351
351
|
max_scroll_percent: z.ZodNullable<z.ZodNumber>;
|
|
352
|
+
scroll_baseline_percent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
352
353
|
page: z.ZodObject<{
|
|
353
354
|
path: z.ZodString;
|
|
354
355
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -362,12 +363,14 @@ declare const pageExitMetadataSchema: z.ZodObject<{
|
|
|
362
363
|
};
|
|
363
364
|
dwell_ms: number;
|
|
364
365
|
max_scroll_percent: number | null;
|
|
366
|
+
scroll_baseline_percent?: number | null | undefined;
|
|
365
367
|
}, {
|
|
366
368
|
page: {
|
|
367
369
|
path: string;
|
|
368
370
|
};
|
|
369
371
|
dwell_ms: number;
|
|
370
372
|
max_scroll_percent: number | null;
|
|
373
|
+
scroll_baseline_percent?: number | null | undefined;
|
|
371
374
|
}>;
|
|
372
375
|
type PageExitMetadata = z.infer<typeof pageExitMetadataSchema>;
|
|
373
376
|
/**
|
|
@@ -649,10 +652,101 @@ declare const timeOnSiteConfigSchema: z.ZodObject<{
|
|
|
649
652
|
}>;
|
|
650
653
|
type TimeOnSiteConfig = z.infer<typeof timeOnSiteConfigSchema>;
|
|
651
654
|
|
|
655
|
+
type EventOutcomeRole = "lead" | "engagement" | "navigation" | "diagnostic";
|
|
656
|
+
type EventCategory = "page" | "engagement" | "lead" | "commerce" | "system";
|
|
657
|
+
type EventClientVisibility = "simple" | "detailed" | "hidden";
|
|
658
|
+
interface EventSemantics {
|
|
659
|
+
label: string;
|
|
660
|
+
category: EventCategory;
|
|
661
|
+
outcomeRole: EventOutcomeRole;
|
|
662
|
+
clientVisibility: EventClientVisibility;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Lightweight runtime event metadata. This module intentionally imports no
|
|
666
|
+
* Zod schemas so dashboards and framework adapters can consume it without
|
|
667
|
+
* pulling the validation registry into their bundles.
|
|
668
|
+
*/
|
|
669
|
+
declare const EVENT_SEMANTICS: {
|
|
670
|
+
readonly page_view: {
|
|
671
|
+
readonly label: "Page view";
|
|
672
|
+
readonly category: "page";
|
|
673
|
+
readonly outcomeRole: "navigation";
|
|
674
|
+
readonly clientVisibility: "simple";
|
|
675
|
+
};
|
|
676
|
+
readonly time_on_site: {
|
|
677
|
+
readonly label: "Time on site";
|
|
678
|
+
readonly category: "engagement";
|
|
679
|
+
readonly outcomeRole: "engagement";
|
|
680
|
+
readonly clientVisibility: "detailed";
|
|
681
|
+
};
|
|
682
|
+
readonly specific_page_visit: {
|
|
683
|
+
readonly label: "Key page visit";
|
|
684
|
+
readonly category: "engagement";
|
|
685
|
+
readonly outcomeRole: "engagement";
|
|
686
|
+
readonly clientVisibility: "detailed";
|
|
687
|
+
};
|
|
688
|
+
readonly scroll_depth: {
|
|
689
|
+
readonly label: "Scroll depth";
|
|
690
|
+
readonly category: "engagement";
|
|
691
|
+
readonly outcomeRole: "engagement";
|
|
692
|
+
readonly clientVisibility: "detailed";
|
|
693
|
+
};
|
|
694
|
+
readonly multi_page_session: {
|
|
695
|
+
readonly label: "Multi-page session";
|
|
696
|
+
readonly category: "engagement";
|
|
697
|
+
readonly outcomeRole: "engagement";
|
|
698
|
+
readonly clientVisibility: "detailed";
|
|
699
|
+
};
|
|
700
|
+
readonly form_start: {
|
|
701
|
+
readonly label: "Form started";
|
|
702
|
+
readonly category: "engagement";
|
|
703
|
+
readonly outcomeRole: "engagement";
|
|
704
|
+
readonly clientVisibility: "simple";
|
|
705
|
+
};
|
|
706
|
+
readonly sdk_heartbeat: {
|
|
707
|
+
readonly label: "SDK heartbeat";
|
|
708
|
+
readonly category: "system";
|
|
709
|
+
readonly outcomeRole: "diagnostic";
|
|
710
|
+
readonly clientVisibility: "hidden";
|
|
711
|
+
};
|
|
712
|
+
readonly page_exit: {
|
|
713
|
+
readonly label: "Page exit";
|
|
714
|
+
readonly category: "engagement";
|
|
715
|
+
readonly outcomeRole: "diagnostic";
|
|
716
|
+
readonly clientVisibility: "detailed";
|
|
717
|
+
};
|
|
718
|
+
readonly form_submit: {
|
|
719
|
+
readonly label: "Form submitted";
|
|
720
|
+
readonly category: "lead";
|
|
721
|
+
readonly outcomeRole: "lead";
|
|
722
|
+
readonly clientVisibility: "simple";
|
|
723
|
+
};
|
|
724
|
+
readonly phone_click: {
|
|
725
|
+
readonly label: "Phone click";
|
|
726
|
+
readonly category: "lead";
|
|
727
|
+
readonly outcomeRole: "lead";
|
|
728
|
+
readonly clientVisibility: "simple";
|
|
729
|
+
};
|
|
730
|
+
readonly cta_click: {
|
|
731
|
+
readonly label: "CTA click";
|
|
732
|
+
readonly category: "engagement";
|
|
733
|
+
readonly outcomeRole: "engagement";
|
|
734
|
+
readonly clientVisibility: "simple";
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
type EventName = keyof typeof EVENT_SEMANTICS;
|
|
738
|
+
declare function getEventSemantics(eventName: string): EventSemantics | null;
|
|
739
|
+
|
|
652
740
|
type EventKind = "automatic" | "manual";
|
|
653
741
|
declare const EVENT_REGISTRY: {
|
|
654
742
|
readonly page_view: {
|
|
655
743
|
readonly kind: "automatic";
|
|
744
|
+
readonly semantics: {
|
|
745
|
+
readonly label: "Page view";
|
|
746
|
+
readonly category: "page";
|
|
747
|
+
readonly outcomeRole: "navigation";
|
|
748
|
+
readonly clientVisibility: "simple";
|
|
749
|
+
};
|
|
656
750
|
readonly metadataSchema: z.ZodObject<{
|
|
657
751
|
page: z.ZodObject<{
|
|
658
752
|
title: z.ZodNullable<z.ZodString>;
|
|
@@ -710,6 +804,12 @@ declare const EVENT_REGISTRY: {
|
|
|
710
804
|
};
|
|
711
805
|
readonly time_on_site: {
|
|
712
806
|
readonly kind: "automatic";
|
|
807
|
+
readonly semantics: {
|
|
808
|
+
readonly label: "Time on site";
|
|
809
|
+
readonly category: "engagement";
|
|
810
|
+
readonly outcomeRole: "engagement";
|
|
811
|
+
readonly clientVisibility: "detailed";
|
|
812
|
+
};
|
|
713
813
|
readonly metadataSchema: z.ZodObject<{
|
|
714
814
|
duration_ms: z.ZodNumber;
|
|
715
815
|
page: z.ZodObject<{
|
|
@@ -740,6 +840,12 @@ declare const EVENT_REGISTRY: {
|
|
|
740
840
|
};
|
|
741
841
|
readonly specific_page_visit: {
|
|
742
842
|
readonly kind: "automatic";
|
|
843
|
+
readonly semantics: {
|
|
844
|
+
readonly label: "Key page visit";
|
|
845
|
+
readonly category: "engagement";
|
|
846
|
+
readonly outcomeRole: "engagement";
|
|
847
|
+
readonly clientVisibility: "detailed";
|
|
848
|
+
};
|
|
743
849
|
readonly metadataSchema: z.ZodObject<{
|
|
744
850
|
page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
745
851
|
page: z.ZodObject<{
|
|
@@ -785,6 +891,12 @@ declare const EVENT_REGISTRY: {
|
|
|
785
891
|
};
|
|
786
892
|
readonly scroll_depth: {
|
|
787
893
|
readonly kind: "automatic";
|
|
894
|
+
readonly semantics: {
|
|
895
|
+
readonly label: "Scroll depth";
|
|
896
|
+
readonly category: "engagement";
|
|
897
|
+
readonly outcomeRole: "engagement";
|
|
898
|
+
readonly clientVisibility: "detailed";
|
|
899
|
+
};
|
|
788
900
|
readonly metadataSchema: z.ZodObject<{
|
|
789
901
|
depth_percent: z.ZodNumber;
|
|
790
902
|
page: z.ZodObject<{
|
|
@@ -815,6 +927,12 @@ declare const EVENT_REGISTRY: {
|
|
|
815
927
|
};
|
|
816
928
|
readonly multi_page_session: {
|
|
817
929
|
readonly kind: "automatic";
|
|
930
|
+
readonly semantics: {
|
|
931
|
+
readonly label: "Multi-page session";
|
|
932
|
+
readonly category: "engagement";
|
|
933
|
+
readonly outcomeRole: "engagement";
|
|
934
|
+
readonly clientVisibility: "detailed";
|
|
935
|
+
};
|
|
818
936
|
readonly metadataSchema: z.ZodObject<{
|
|
819
937
|
page_count: z.ZodNumber;
|
|
820
938
|
page: z.ZodObject<{
|
|
@@ -845,6 +963,12 @@ declare const EVENT_REGISTRY: {
|
|
|
845
963
|
};
|
|
846
964
|
readonly form_start: {
|
|
847
965
|
readonly kind: "automatic";
|
|
966
|
+
readonly semantics: {
|
|
967
|
+
readonly label: "Form started";
|
|
968
|
+
readonly category: "engagement";
|
|
969
|
+
readonly outcomeRole: "engagement";
|
|
970
|
+
readonly clientVisibility: "simple";
|
|
971
|
+
};
|
|
848
972
|
readonly metadataSchema: z.ZodObject<{
|
|
849
973
|
form: z.ZodObject<{
|
|
850
974
|
id: z.ZodString;
|
|
@@ -890,6 +1014,12 @@ declare const EVENT_REGISTRY: {
|
|
|
890
1014
|
};
|
|
891
1015
|
readonly sdk_heartbeat: {
|
|
892
1016
|
readonly kind: "automatic";
|
|
1017
|
+
readonly semantics: {
|
|
1018
|
+
readonly label: "SDK heartbeat";
|
|
1019
|
+
readonly category: "system";
|
|
1020
|
+
readonly outcomeRole: "diagnostic";
|
|
1021
|
+
readonly clientVisibility: "hidden";
|
|
1022
|
+
};
|
|
893
1023
|
readonly metadataSchema: z.ZodObject<{
|
|
894
1024
|
sdk_version: z.ZodString;
|
|
895
1025
|
package_name: z.ZodNullable<z.ZodString>;
|
|
@@ -931,9 +1061,16 @@ declare const EVENT_REGISTRY: {
|
|
|
931
1061
|
};
|
|
932
1062
|
readonly page_exit: {
|
|
933
1063
|
readonly kind: "automatic";
|
|
1064
|
+
readonly semantics: {
|
|
1065
|
+
readonly label: "Page exit";
|
|
1066
|
+
readonly category: "engagement";
|
|
1067
|
+
readonly outcomeRole: "diagnostic";
|
|
1068
|
+
readonly clientVisibility: "detailed";
|
|
1069
|
+
};
|
|
934
1070
|
readonly metadataSchema: z.ZodObject<{
|
|
935
1071
|
dwell_ms: z.ZodNumber;
|
|
936
1072
|
max_scroll_percent: z.ZodNullable<z.ZodNumber>;
|
|
1073
|
+
scroll_baseline_percent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
937
1074
|
page: z.ZodObject<{
|
|
938
1075
|
path: z.ZodString;
|
|
939
1076
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -947,17 +1084,25 @@ declare const EVENT_REGISTRY: {
|
|
|
947
1084
|
};
|
|
948
1085
|
dwell_ms: number;
|
|
949
1086
|
max_scroll_percent: number | null;
|
|
1087
|
+
scroll_baseline_percent?: number | null | undefined;
|
|
950
1088
|
}, {
|
|
951
1089
|
page: {
|
|
952
1090
|
path: string;
|
|
953
1091
|
};
|
|
954
1092
|
dwell_ms: number;
|
|
955
1093
|
max_scroll_percent: number | null;
|
|
1094
|
+
scroll_baseline_percent?: number | null | undefined;
|
|
956
1095
|
}>;
|
|
957
1096
|
readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
958
1097
|
};
|
|
959
1098
|
readonly form_submit: {
|
|
960
1099
|
readonly kind: "manual";
|
|
1100
|
+
readonly semantics: {
|
|
1101
|
+
readonly label: "Form submitted";
|
|
1102
|
+
readonly category: "lead";
|
|
1103
|
+
readonly outcomeRole: "lead";
|
|
1104
|
+
readonly clientVisibility: "simple";
|
|
1105
|
+
};
|
|
961
1106
|
readonly metadataSchema: z.ZodObject<{
|
|
962
1107
|
form: z.ZodObject<{
|
|
963
1108
|
id: z.ZodString;
|
|
@@ -1037,6 +1182,12 @@ declare const EVENT_REGISTRY: {
|
|
|
1037
1182
|
};
|
|
1038
1183
|
readonly phone_click: {
|
|
1039
1184
|
readonly kind: "manual";
|
|
1185
|
+
readonly semantics: {
|
|
1186
|
+
readonly label: "Phone click";
|
|
1187
|
+
readonly category: "lead";
|
|
1188
|
+
readonly outcomeRole: "lead";
|
|
1189
|
+
readonly clientVisibility: "simple";
|
|
1190
|
+
};
|
|
1040
1191
|
readonly metadataSchema: z.ZodObject<{
|
|
1041
1192
|
phone_number: z.ZodString;
|
|
1042
1193
|
page: z.ZodObject<{
|
|
@@ -1080,6 +1231,12 @@ declare const EVENT_REGISTRY: {
|
|
|
1080
1231
|
};
|
|
1081
1232
|
readonly cta_click: {
|
|
1082
1233
|
readonly kind: "manual";
|
|
1234
|
+
readonly semantics: {
|
|
1235
|
+
readonly label: "CTA click";
|
|
1236
|
+
readonly category: "engagement";
|
|
1237
|
+
readonly outcomeRole: "engagement";
|
|
1238
|
+
readonly clientVisibility: "simple";
|
|
1239
|
+
};
|
|
1083
1240
|
readonly metadataSchema: z.ZodObject<{
|
|
1084
1241
|
cta_name: z.ZodString;
|
|
1085
1242
|
page: z.ZodObject<{
|
|
@@ -1099,8 +1256,8 @@ declare const EVENT_REGISTRY: {
|
|
|
1099
1256
|
};
|
|
1100
1257
|
cta_name: string;
|
|
1101
1258
|
section?: string | null | undefined;
|
|
1102
|
-
destination_url?: string | null | undefined;
|
|
1103
1259
|
href?: string | null | undefined;
|
|
1260
|
+
destination_url?: string | null | undefined;
|
|
1104
1261
|
element?: string | null | undefined;
|
|
1105
1262
|
}, {
|
|
1106
1263
|
page: {
|
|
@@ -1108,8 +1265,8 @@ declare const EVENT_REGISTRY: {
|
|
|
1108
1265
|
};
|
|
1109
1266
|
cta_name: string;
|
|
1110
1267
|
section?: string | null | undefined;
|
|
1111
|
-
destination_url?: string | null | undefined;
|
|
1112
1268
|
href?: string | null | undefined;
|
|
1269
|
+
destination_url?: string | null | undefined;
|
|
1113
1270
|
element?: string | null | undefined;
|
|
1114
1271
|
}>;
|
|
1115
1272
|
readonly configSchema: z.ZodObject<{
|
|
@@ -1131,10 +1288,6 @@ declare const EVENT_REGISTRY: {
|
|
|
1131
1288
|
}>;
|
|
1132
1289
|
};
|
|
1133
1290
|
};
|
|
1134
|
-
/**
|
|
1135
|
-
* Name of any event known to the tracking SDK.
|
|
1136
|
-
*/
|
|
1137
|
-
type EventName = keyof typeof EVENT_REGISTRY;
|
|
1138
1291
|
/**
|
|
1139
1292
|
* Event names that are fired by the SDK when their configured signal occurs.
|
|
1140
1293
|
*
|
|
@@ -1196,6 +1349,10 @@ declare const ALL_AUTOMATIC_EVENT_NAMES: readonly AutomaticEventName[];
|
|
|
1196
1349
|
* Runtime list of manual event names.
|
|
1197
1350
|
*/
|
|
1198
1351
|
declare const ALL_MANUAL_EVENT_NAMES: readonly ManualEventName[];
|
|
1352
|
+
/**
|
|
1353
|
+
* Events that represent a lead/outcome in first-party tracking projections.
|
|
1354
|
+
*/
|
|
1355
|
+
declare const ALL_LEAD_EVENT_NAMES: readonly EventName[];
|
|
1199
1356
|
/**
|
|
1200
1357
|
* Trigger registry passed to `createTracking({ triggers })`.
|
|
1201
1358
|
*
|
|
@@ -1259,6 +1416,7 @@ type TrackableEvent<TRegistry extends TriggerRegistryConfig> = {
|
|
|
1259
1416
|
}[RegisteredManualEvents<TRegistry>];
|
|
1260
1417
|
declare function getEventDefinition(name: EventName): {
|
|
1261
1418
|
kind: EventKind;
|
|
1419
|
+
semantics: EventSemantics;
|
|
1262
1420
|
metadataSchema: z.ZodTypeAny;
|
|
1263
1421
|
configSchema: z.ZodTypeAny;
|
|
1264
1422
|
};
|
|
@@ -1357,6 +1515,10 @@ interface AdPlatformTrackingProps {
|
|
|
1357
1515
|
gtagId?: string;
|
|
1358
1516
|
/** Labelled Google Ads tag map — ALL loaded; wins over `gtagId`. */
|
|
1359
1517
|
gtagIds?: GtagEnvironmentMap;
|
|
1518
|
+
/** R2-authoritative Google tracking config. When set, static gtagId(s) are ignored. */
|
|
1519
|
+
trackingConfig?: TrackingConfigReference;
|
|
1520
|
+
/** Fire a Google page view from this standalone loader. Leave false when using TrackingProvider. */
|
|
1521
|
+
standalonePageView?: boolean;
|
|
1360
1522
|
/** Single Meta Pixel id, e.g. `123456789012345`. */
|
|
1361
1523
|
metaPixelId?: string;
|
|
1362
1524
|
/** Labelled Meta Pixel map — ALL loaded; wins over `metaPixelId`. */
|
|
@@ -1372,7 +1534,7 @@ interface AdPlatformTrackingProps {
|
|
|
1372
1534
|
* accepts the same `gtagId/gtagIds` + `metaPixelId/metaPixelIds` props. Use this
|
|
1373
1535
|
* standalone component when you want the ad tags WITHOUT the event-ingest SDK.
|
|
1374
1536
|
*/
|
|
1375
|
-
declare function AdPlatformTracking({ gtagId, gtagIds, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): null;
|
|
1537
|
+
declare function AdPlatformTracking({ gtagId, gtagIds, trackingConfig, standalonePageView, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): null;
|
|
1376
1538
|
|
|
1377
1539
|
/**
|
|
1378
1540
|
* Props for the Google Ads tracking component.
|
|
@@ -1542,6 +1704,7 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
|
|
|
1542
1704
|
cdnUrl: string;
|
|
1543
1705
|
baked?: ConversionConfig | null;
|
|
1544
1706
|
};
|
|
1707
|
+
trackingConfig?: TrackingConfigReference;
|
|
1545
1708
|
}
|
|
1546
1709
|
interface TrackingProviderProps {
|
|
1547
1710
|
/**
|
|
@@ -1641,4 +1804,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1641
1804
|
*/
|
|
1642
1805
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1643
1806
|
|
|
1644
|
-
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentChoiceState, ConsentSource, ConsentState, ConversionConfig, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, EVENT_REGISTRY, type EventConfig, type EventKind, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, FormSubmitConfig, FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, GtagEnvironmentMap, type ManualEventName, MetaPixelEnvironmentMap, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageExitConfig, type PageExitMetadata, type PageViewConfig, type PageViewMetadata, ParsedPhone, type PhoneClickConfig, type PhoneClickMetadata, PhoneConfig, PhoneDisplayFormat, PhoneField, type PhoneFieldApi, type PhoneFieldProps, type PhoneInputProps, type RegisteredAutomaticEvents, type RegisteredManualEvents, SPECIFIC_PAGE_NAMES, type ScrollDepthConfig, type ScrollDepthMetadata, type SdkHeartbeatConfig, type SdkHeartbeatMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackableEvent, type TrackingClient, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getEventDefinition, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageExitConfigSchema, pageExitMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
|
1807
|
+
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_LEAD_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentChoiceState, ConsentSource, ConsentState, ConversionConfig, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, EVENT_REGISTRY, EVENT_SEMANTICS, type EventCategory, type EventClientVisibility, type EventConfig, type EventKind, type EventMetadata, type EventName, type EventOutcomeRole, type EventSemantics, type FormStartConfig, type FormStartMetadata, FormSubmitConfig, FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, GtagEnvironmentMap, type ManualEventName, MetaPixelEnvironmentMap, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageExitConfig, type PageExitMetadata, type PageViewConfig, type PageViewMetadata, ParsedPhone, type PhoneClickConfig, type PhoneClickMetadata, PhoneConfig, PhoneDisplayFormat, PhoneField, type PhoneFieldApi, type PhoneFieldProps, type PhoneInputProps, type RegisteredAutomaticEvents, type RegisteredManualEvents, SPECIFIC_PAGE_NAMES, type ScrollDepthConfig, type ScrollDepthMetadata, type SdkHeartbeatConfig, type SdkHeartbeatMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackableEvent, type TrackingClient, TrackingClientContext, TrackingConfigReference, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getEventDefinition, getEventSemantics, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageExitConfigSchema, pageExitMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|