@aranova/tracking-react 0.17.3 → 0.18.1

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 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 gtagId={import.meta.env.VITE_GTAG_ID}>
51
+ <TrackingProvider>
50
52
  <App />
51
53
  </TrackingProvider>,
52
54
  );
53
55
  ```
54
56
 
55
- ### Multiple gtag IDs
57
+ ### Legacy static gtag IDs
56
58
 
57
- Pass `gtagIds` (instead of `gtagId`) to install several Google Ads tags at once — e.g. a real
58
- account plus a test MCC. Each entry fires `gtag('config', …)` on every page; the labels surface in
59
- the dashboard's SDK table. Stamp events with `environment` to filter out test traffic.
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" }}>
@@ -109,7 +112,7 @@ export function LeadForm() {
109
112
  }
110
113
  ```
111
114
 
112
- `fields[].value` can be any JSON value: string, number, boolean, null, array, or object. Values must be JSON-serializable because events are stored as JSONB. Only send reviewed, allowlisted, non-sensitive values; do not send names, emails, phone numbers entered by the visitor, addresses, payment data, medical details, passwords, file contents, or free-text messages.
115
+ `fields[].value` can be any JSON value: string, number, boolean, null, array, or object. Values must be JSON-serializable because events are stored as first-party JSONB. Intentionally submitted lead fields may include raw names, emails, phone numbers, addresses, selections, free-text messages, and submitted file data for first-party analytics and lead operations. Build the array explicitly from the submitted form; the SDK never scrapes arbitrary DOM fields. `File`/`Blob` objects must be converted to a JSON representation, and the complete event metadata must fit the 4 KB limit; upload larger files separately and send their storage reference. Never send passwords, authentication tokens, payment-card/bank credentials, or private keys. Apply the client's privacy notice, consent, retention, and regulated-data requirements. Google offline matching uses normalized, server-side SHA-256-hashed identifiers — not raw free-text/file metadata.
113
116
 
114
117
  ### Phone clicks (`tel:` taps) — manual or auto-capture
115
118
 
@@ -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
- Map conversion actions in the Aranova dashboard, run `tracking-cli gen` to bake `ARANOVA_CONFIG_URL`, then pass it to `createTracking`. The SDK fires `gtag('event','conversion', …)` on-page and reads the per-business config from the CDN with stale-while-revalidate — so **changing the mapping needs no client redeploy**.
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 { createTracking } from "@aranova/tracking-react";
281
- import { ARANOVA_CONFIG_URL } from "./aranova-services"; // emitted by `tracking-cli gen`
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
- conversionConfig: { cdnUrl: ARANOVA_CONFIG_URL },
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: resolveConversionConfig({ cdnUrl: ARANOVA_CONFIG_URL }),
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 no-ops if the goal isn't mapped. Firing is consent-gated, de-duped by `transaction_id`, and no-ops server-side. The config bucket needs an R2 CORS policy — see [conversion-config-schema.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/conversion-config-schema.md).
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
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
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
- 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-C3jFBx08.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, T as SaleSummaryQuery, U as SaleSummaryQueryV2, V as SaleSummaryV2, W as SaleUpdateInput, X as SalesBusinessClient, Y as SalesCategoryBreakdown, Z as SalesClient, _ as SalesClientConfig, $ as SalesCustomersClient, a0 as SalesServiceBreakdown, a1 as SalesTransportConfig, a2 as SalesTrendPoint, a3 as SummaryCurrencyDelta, a4 as SummaryDeltas, a5 as SummaryWindow, a6 as SupportedCurrency, a7 as TRACKING_RANGES, a8 as TrackingOverviewRange, a9 as createSalesClient, aa as fetchServices, ab as formatDateInTz, ac as formatMoney, ad as fromMinor, ae as resolveConversionConfig, af as saleCreateSchema, ag as saleItemSchema, ah as saleServiceSchema, ai as saleUpdateSchema, aj as salesRequest, ak as toMinor } from './sales-C3jFBx08.mjs';
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-CVCzW04Z.mjs';
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-CVCzW04Z.mjs';
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>;
@@ -652,10 +652,101 @@ declare const timeOnSiteConfigSchema: z.ZodObject<{
652
652
  }>;
653
653
  type TimeOnSiteConfig = z.infer<typeof timeOnSiteConfigSchema>;
654
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
+
655
740
  type EventKind = "automatic" | "manual";
656
741
  declare const EVENT_REGISTRY: {
657
742
  readonly page_view: {
658
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
+ };
659
750
  readonly metadataSchema: z.ZodObject<{
660
751
  page: z.ZodObject<{
661
752
  title: z.ZodNullable<z.ZodString>;
@@ -713,6 +804,12 @@ declare const EVENT_REGISTRY: {
713
804
  };
714
805
  readonly time_on_site: {
715
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
+ };
716
813
  readonly metadataSchema: z.ZodObject<{
717
814
  duration_ms: z.ZodNumber;
718
815
  page: z.ZodObject<{
@@ -743,6 +840,12 @@ declare const EVENT_REGISTRY: {
743
840
  };
744
841
  readonly specific_page_visit: {
745
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
+ };
746
849
  readonly metadataSchema: z.ZodObject<{
747
850
  page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
748
851
  page: z.ZodObject<{
@@ -788,6 +891,12 @@ declare const EVENT_REGISTRY: {
788
891
  };
789
892
  readonly scroll_depth: {
790
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
+ };
791
900
  readonly metadataSchema: z.ZodObject<{
792
901
  depth_percent: z.ZodNumber;
793
902
  page: z.ZodObject<{
@@ -818,6 +927,12 @@ declare const EVENT_REGISTRY: {
818
927
  };
819
928
  readonly multi_page_session: {
820
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
+ };
821
936
  readonly metadataSchema: z.ZodObject<{
822
937
  page_count: z.ZodNumber;
823
938
  page: z.ZodObject<{
@@ -848,6 +963,12 @@ declare const EVENT_REGISTRY: {
848
963
  };
849
964
  readonly form_start: {
850
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
+ };
851
972
  readonly metadataSchema: z.ZodObject<{
852
973
  form: z.ZodObject<{
853
974
  id: z.ZodString;
@@ -893,6 +1014,12 @@ declare const EVENT_REGISTRY: {
893
1014
  };
894
1015
  readonly sdk_heartbeat: {
895
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
+ };
896
1023
  readonly metadataSchema: z.ZodObject<{
897
1024
  sdk_version: z.ZodString;
898
1025
  package_name: z.ZodNullable<z.ZodString>;
@@ -934,6 +1061,12 @@ declare const EVENT_REGISTRY: {
934
1061
  };
935
1062
  readonly page_exit: {
936
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
+ };
937
1070
  readonly metadataSchema: z.ZodObject<{
938
1071
  dwell_ms: z.ZodNumber;
939
1072
  max_scroll_percent: z.ZodNullable<z.ZodNumber>;
@@ -964,6 +1097,12 @@ declare const EVENT_REGISTRY: {
964
1097
  };
965
1098
  readonly form_submit: {
966
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
+ };
967
1106
  readonly metadataSchema: z.ZodObject<{
968
1107
  form: z.ZodObject<{
969
1108
  id: z.ZodString;
@@ -1043,6 +1182,12 @@ declare const EVENT_REGISTRY: {
1043
1182
  };
1044
1183
  readonly phone_click: {
1045
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
+ };
1046
1191
  readonly metadataSchema: z.ZodObject<{
1047
1192
  phone_number: z.ZodString;
1048
1193
  page: z.ZodObject<{
@@ -1086,6 +1231,12 @@ declare const EVENT_REGISTRY: {
1086
1231
  };
1087
1232
  readonly cta_click: {
1088
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
+ };
1089
1240
  readonly metadataSchema: z.ZodObject<{
1090
1241
  cta_name: z.ZodString;
1091
1242
  page: z.ZodObject<{
@@ -1105,8 +1256,8 @@ declare const EVENT_REGISTRY: {
1105
1256
  };
1106
1257
  cta_name: string;
1107
1258
  section?: string | null | undefined;
1108
- destination_url?: string | null | undefined;
1109
1259
  href?: string | null | undefined;
1260
+ destination_url?: string | null | undefined;
1110
1261
  element?: string | null | undefined;
1111
1262
  }, {
1112
1263
  page: {
@@ -1114,8 +1265,8 @@ declare const EVENT_REGISTRY: {
1114
1265
  };
1115
1266
  cta_name: string;
1116
1267
  section?: string | null | undefined;
1117
- destination_url?: string | null | undefined;
1118
1268
  href?: string | null | undefined;
1269
+ destination_url?: string | null | undefined;
1119
1270
  element?: string | null | undefined;
1120
1271
  }>;
1121
1272
  readonly configSchema: z.ZodObject<{
@@ -1137,10 +1288,6 @@ declare const EVENT_REGISTRY: {
1137
1288
  }>;
1138
1289
  };
1139
1290
  };
1140
- /**
1141
- * Name of any event known to the tracking SDK.
1142
- */
1143
- type EventName = keyof typeof EVENT_REGISTRY;
1144
1291
  /**
1145
1292
  * Event names that are fired by the SDK when their configured signal occurs.
1146
1293
  *
@@ -1202,6 +1349,10 @@ declare const ALL_AUTOMATIC_EVENT_NAMES: readonly AutomaticEventName[];
1202
1349
  * Runtime list of manual event names.
1203
1350
  */
1204
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[];
1205
1356
  /**
1206
1357
  * Trigger registry passed to `createTracking({ triggers })`.
1207
1358
  *
@@ -1265,6 +1416,7 @@ type TrackableEvent<TRegistry extends TriggerRegistryConfig> = {
1265
1416
  }[RegisteredManualEvents<TRegistry>];
1266
1417
  declare function getEventDefinition(name: EventName): {
1267
1418
  kind: EventKind;
1419
+ semantics: EventSemantics;
1268
1420
  metadataSchema: z.ZodTypeAny;
1269
1421
  configSchema: z.ZodTypeAny;
1270
1422
  };
@@ -1363,6 +1515,10 @@ interface AdPlatformTrackingProps {
1363
1515
  gtagId?: string;
1364
1516
  /** Labelled Google Ads tag map — ALL loaded; wins over `gtagId`. */
1365
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;
1366
1522
  /** Single Meta Pixel id, e.g. `123456789012345`. */
1367
1523
  metaPixelId?: string;
1368
1524
  /** Labelled Meta Pixel map — ALL loaded; wins over `metaPixelId`. */
@@ -1378,7 +1534,7 @@ interface AdPlatformTrackingProps {
1378
1534
  * accepts the same `gtagId/gtagIds` + `metaPixelId/metaPixelIds` props. Use this
1379
1535
  * standalone component when you want the ad tags WITHOUT the event-ingest SDK.
1380
1536
  */
1381
- declare function AdPlatformTracking({ gtagId, gtagIds, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): null;
1537
+ declare function AdPlatformTracking({ gtagId, gtagIds, trackingConfig, standalonePageView, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): null;
1382
1538
 
1383
1539
  /**
1384
1540
  * Props for the Google Ads tracking component.
@@ -1548,6 +1704,7 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
1548
1704
  cdnUrl: string;
1549
1705
  baked?: ConversionConfig | null;
1550
1706
  };
1707
+ trackingConfig?: TrackingConfigReference;
1551
1708
  }
1552
1709
  interface TrackingProviderProps {
1553
1710
  /**
@@ -1647,4 +1804,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
1647
1804
  */
1648
1805
  declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
1649
1806
 
1650
- 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 };