@aranova/tracking-react 0.13.0 → 0.14.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 +38 -0
- package/dist/index.d.mts +26 -14
- package/dist/index.d.ts +26 -14
- package/dist/index.js +398 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +397 -65
- package/dist/index.mjs.map +1 -1
- package/dist/phone.js +73 -0
- package/dist/phone.js.map +1 -1
- package/dist/phone.mjs +73 -0
- package/dist/phone.mjs.map +1 -1
- package/dist/sales-BsJodmh0.d.mts +887 -0
- package/dist/sales-BsJodmh0.d.ts +887 -0
- package/dist/sales.d.mts +2 -784
- package/dist/sales.d.ts +2 -784
- package/dist/sales.js +172 -45
- package/dist/sales.js.map +1 -1
- package/dist/sales.mjs +172 -45
- package/dist/sales.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -202,6 +202,44 @@ npx @aranova/tracking-cli gen # reads ARANOVA_TRACKING_SECRET_KEY from
|
|
|
202
202
|
See the full guide: [sales-tracking.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/sales-tracking.md)
|
|
203
203
|
and the CLI reference: [cli.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/cli.md).
|
|
204
204
|
|
|
205
|
+
## On-site conversion firing
|
|
206
|
+
|
|
207
|
+
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**.
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
import { createTracking } from "@aranova/tracking-react";
|
|
211
|
+
import { ARANOVA_CONFIG_URL } from "./aranova-services"; // emitted by `tracking-cli gen`
|
|
212
|
+
|
|
213
|
+
export const { TrackingProvider, useTracking } = createTracking({
|
|
214
|
+
apiKey,
|
|
215
|
+
endpoint,
|
|
216
|
+
triggers,
|
|
217
|
+
conversionConfig: { cdnUrl: ARANOVA_CONFIG_URL },
|
|
218
|
+
});
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
- **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.
|
|
222
|
+
- **Sales + manual events** fire through the sales client. Give it the same config:
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
import { createSalesClient, resolveConversionConfig, toMinor } from "@aranova/tracking-react";
|
|
226
|
+
|
|
227
|
+
const sales = createSalesClient({
|
|
228
|
+
apiKey,
|
|
229
|
+
endpoint,
|
|
230
|
+
firing: resolveConversionConfig({ cdnUrl: ARANOVA_CONFIG_URL }),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
await sales.recordSale({
|
|
234
|
+
currency: "CAD",
|
|
235
|
+
amount_total_cents: toMinor(250, "CAD"),
|
|
236
|
+
service: "tires",
|
|
237
|
+
}); // records + fires
|
|
238
|
+
sales.trackConversion("phone_click"); // fires a manual event-goal only (no sale recorded)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
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).
|
|
242
|
+
|
|
205
243
|
## Consent UI
|
|
206
244
|
|
|
207
245
|
The bundled `<ConsentBanner />` renders a non-blocking bottom-docked banner while consent is `pending`, persists the visitor's choice to `localStorage`, and propagates it to Google Consent Mode v2 when gtag is loaded. **Inline-styled** — no Tailwind or CSS imports required at the consumer.
|
package/dist/index.d.mts
CHANGED
|
@@ -2,9 +2,10 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
|
|
3
3
|
import { C as ConsentState, T as TrackingInstallSurface, a as TrackingEnvironment, b as TrackingClientContext, c as TrackingParams, d as TrackingEventCreatePayload, e as TrackingSessionUpsertPayload, F as FormSubmitConfig, f as FormSubmitMetadata, G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, P as PhoneConfig, g as ParsedPhone, h as PhoneDisplayFormat } from './phone-utils-Dyk0F14_.mjs';
|
|
4
4
|
export { D as DEFAULT_PHONE_COUNTRY, J as JsonValue, i as TrackedField, j as TrackingInitConfig, k as formSubmitConfigSchema, l as formSubmitMetadataSchema, m as formatPhone, n as formatPhoneAsTyped, o as jsonValueSchema, p as parsePhone, q as phoneField, t as toE164 } from './phone-utils-Dyk0F14_.mjs';
|
|
5
|
+
import { C as ConversionConfig } from './sales-BsJodmh0.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-BsJodmh0.mjs';
|
|
5
7
|
import * as src from 'src';
|
|
6
8
|
import { z } from 'zod';
|
|
7
|
-
export { AranovaApiError, BusinessConfig, BusinessConfigFeatures, BusinessConfigService, CompareTo, CurrencyRevenue, CustomerCurrencyDelta, CustomerCurrencyTotal, CustomerGetOptions, CustomerGetResult, CustomerKpis, CustomerKpisDeltas, CustomerKpisPrevious, CustomerListPage, CustomerListQuery, CustomerProfile, CustomerSegment, CustomerSegmentCount, CustomerSortField, CustomerSummary, CustomerSummaryQuery, DistinctCustomersByCurrency, Granularity, NAMED_RANGES, NamedRange, PublicServiceItem, SUPPORTED_CURRENCIES, Sale, SaleCursorPage, SaleFilters, SaleInput, SaleItem, SaleItemInput, SaleKeysetSortField, SaleListPage, SaleListQuery, SaleListQueryV2, SaleService, SaleServiceInput, SaleSortField, SaleSortOrder, SaleSummary, SaleSummaryPrevious, SaleSummaryQuery, SaleSummaryQueryV2, SaleSummaryV2, SaleUpdateInput, SalesBusinessClient, SalesCategoryBreakdown, SalesClient, SalesClientConfig, SalesCustomersClient, SalesServiceBreakdown, SalesTransportConfig, SalesTrendPoint, SummaryCurrencyDelta, SummaryDeltas, SummaryWindow, SupportedCurrency, TRACKING_RANGES, TrackingOverviewRange, createSalesClient, fetchServices, formatDateInTz, formatMoney, fromMinor, saleCreateSchema, saleItemSchema, saleServiceSchema, saleUpdateSchema, salesRequest, toMinor } from './sales.mjs';
|
|
8
9
|
import { CountryCode } from 'libphonenumber-js';
|
|
9
10
|
export { CountryCode } from 'libphonenumber-js';
|
|
10
11
|
|
|
@@ -140,18 +141,6 @@ declare function createTrackingSessionUpsertPayload(trackingParams: TrackingPara
|
|
|
140
141
|
*/
|
|
141
142
|
declare function createTrackingEventCreatePayload(trackingParams: TrackingParams, input: TrackingEventInput, context: TrackingClientContext): TrackingEventCreatePayload;
|
|
142
143
|
|
|
143
|
-
/**
|
|
144
|
-
* Attribution query/cookie keys captured by the SDK.
|
|
145
|
-
*/
|
|
146
|
-
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
147
|
-
/**
|
|
148
|
-
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
149
|
-
* return the current cookie-backed attribution state.
|
|
150
|
-
*
|
|
151
|
-
* Defaults to `window.location.href` in the browser.
|
|
152
|
-
*/
|
|
153
|
-
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
154
|
-
|
|
155
144
|
/**
|
|
156
145
|
* Metadata for a manually fired `cta_click` event.
|
|
157
146
|
*
|
|
@@ -1184,6 +1173,18 @@ interface TrackingClient {
|
|
|
1184
1173
|
destroy: () => void;
|
|
1185
1174
|
}
|
|
1186
1175
|
|
|
1176
|
+
/**
|
|
1177
|
+
* Attribution query/cookie keys captured by the SDK.
|
|
1178
|
+
*/
|
|
1179
|
+
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
1180
|
+
/**
|
|
1181
|
+
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
1182
|
+
* return the current cookie-backed attribution state.
|
|
1183
|
+
*
|
|
1184
|
+
* Defaults to `window.location.href` in the browser.
|
|
1185
|
+
*/
|
|
1186
|
+
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
1187
|
+
|
|
1187
1188
|
interface TypedTrackEventOptions {
|
|
1188
1189
|
/**
|
|
1189
1190
|
* Override the page URL associated with this event.
|
|
@@ -1373,6 +1374,17 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
|
|
|
1373
1374
|
* `<PhoneField>`. Display is customizable; the transmitted value is always E.164.
|
|
1374
1375
|
*/
|
|
1375
1376
|
phone?: PhoneConfig;
|
|
1377
|
+
/**
|
|
1378
|
+
* GAP28 / unified-goal: enable real-time on-site conversion firing. When set, the SDK
|
|
1379
|
+
* fetches the per-business config from `cdnUrl` (optional offline `baked` fallback) and
|
|
1380
|
+
* AUTOMATICALLY fires `gtag('event','conversion')` for any automatic event-goal
|
|
1381
|
+
* (scroll/time/page-view/…) whose trigger threshold a detector crosses. Omit to keep events
|
|
1382
|
+
* analytics-only. (Sale + manual-event firing lives in the server/browser sales client.)
|
|
1383
|
+
*/
|
|
1384
|
+
conversionConfig?: {
|
|
1385
|
+
cdnUrl: string;
|
|
1386
|
+
baked?: ConversionConfig | null;
|
|
1387
|
+
};
|
|
1376
1388
|
}
|
|
1377
1389
|
interface TrackingProviderProps {
|
|
1378
1390
|
/**
|
|
@@ -1472,4 +1484,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1472
1484
|
*/
|
|
1473
1485
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1474
1486
|
|
|
1475
|
-
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentState, 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 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 UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getConsentState, getEventDefinition, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, resetConsent, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, setConsentState, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
|
1487
|
+
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, 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 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 UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getConsentState, getEventDefinition, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, resetConsent, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, setConsentState, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
|
|
3
3
|
import { C as ConsentState, T as TrackingInstallSurface, a as TrackingEnvironment, b as TrackingClientContext, c as TrackingParams, d as TrackingEventCreatePayload, e as TrackingSessionUpsertPayload, F as FormSubmitConfig, f as FormSubmitMetadata, G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, P as PhoneConfig, g as ParsedPhone, h as PhoneDisplayFormat } from './phone-utils-Dyk0F14_.js';
|
|
4
4
|
export { D as DEFAULT_PHONE_COUNTRY, J as JsonValue, i as TrackedField, j as TrackingInitConfig, k as formSubmitConfigSchema, l as formSubmitMetadataSchema, m as formatPhone, n as formatPhoneAsTyped, o as jsonValueSchema, p as parsePhone, q as phoneField, t as toE164 } from './phone-utils-Dyk0F14_.js';
|
|
5
|
+
import { C as ConversionConfig } from './sales-BsJodmh0.js';
|
|
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-BsJodmh0.js';
|
|
5
7
|
import * as src from 'src';
|
|
6
8
|
import { z } from 'zod';
|
|
7
|
-
export { AranovaApiError, BusinessConfig, BusinessConfigFeatures, BusinessConfigService, CompareTo, CurrencyRevenue, CustomerCurrencyDelta, CustomerCurrencyTotal, CustomerGetOptions, CustomerGetResult, CustomerKpis, CustomerKpisDeltas, CustomerKpisPrevious, CustomerListPage, CustomerListQuery, CustomerProfile, CustomerSegment, CustomerSegmentCount, CustomerSortField, CustomerSummary, CustomerSummaryQuery, DistinctCustomersByCurrency, Granularity, NAMED_RANGES, NamedRange, PublicServiceItem, SUPPORTED_CURRENCIES, Sale, SaleCursorPage, SaleFilters, SaleInput, SaleItem, SaleItemInput, SaleKeysetSortField, SaleListPage, SaleListQuery, SaleListQueryV2, SaleService, SaleServiceInput, SaleSortField, SaleSortOrder, SaleSummary, SaleSummaryPrevious, SaleSummaryQuery, SaleSummaryQueryV2, SaleSummaryV2, SaleUpdateInput, SalesBusinessClient, SalesCategoryBreakdown, SalesClient, SalesClientConfig, SalesCustomersClient, SalesServiceBreakdown, SalesTransportConfig, SalesTrendPoint, SummaryCurrencyDelta, SummaryDeltas, SummaryWindow, SupportedCurrency, TRACKING_RANGES, TrackingOverviewRange, createSalesClient, fetchServices, formatDateInTz, formatMoney, fromMinor, saleCreateSchema, saleItemSchema, saleServiceSchema, saleUpdateSchema, salesRequest, toMinor } from './sales.js';
|
|
8
9
|
import { CountryCode } from 'libphonenumber-js';
|
|
9
10
|
export { CountryCode } from 'libphonenumber-js';
|
|
10
11
|
|
|
@@ -140,18 +141,6 @@ declare function createTrackingSessionUpsertPayload(trackingParams: TrackingPara
|
|
|
140
141
|
*/
|
|
141
142
|
declare function createTrackingEventCreatePayload(trackingParams: TrackingParams, input: TrackingEventInput, context: TrackingClientContext): TrackingEventCreatePayload;
|
|
142
143
|
|
|
143
|
-
/**
|
|
144
|
-
* Attribution query/cookie keys captured by the SDK.
|
|
145
|
-
*/
|
|
146
|
-
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
147
|
-
/**
|
|
148
|
-
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
149
|
-
* return the current cookie-backed attribution state.
|
|
150
|
-
*
|
|
151
|
-
* Defaults to `window.location.href` in the browser.
|
|
152
|
-
*/
|
|
153
|
-
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
154
|
-
|
|
155
144
|
/**
|
|
156
145
|
* Metadata for a manually fired `cta_click` event.
|
|
157
146
|
*
|
|
@@ -1184,6 +1173,18 @@ interface TrackingClient {
|
|
|
1184
1173
|
destroy: () => void;
|
|
1185
1174
|
}
|
|
1186
1175
|
|
|
1176
|
+
/**
|
|
1177
|
+
* Attribution query/cookie keys captured by the SDK.
|
|
1178
|
+
*/
|
|
1179
|
+
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
1180
|
+
/**
|
|
1181
|
+
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
1182
|
+
* return the current cookie-backed attribution state.
|
|
1183
|
+
*
|
|
1184
|
+
* Defaults to `window.location.href` in the browser.
|
|
1185
|
+
*/
|
|
1186
|
+
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
1187
|
+
|
|
1187
1188
|
interface TypedTrackEventOptions {
|
|
1188
1189
|
/**
|
|
1189
1190
|
* Override the page URL associated with this event.
|
|
@@ -1373,6 +1374,17 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
|
|
|
1373
1374
|
* `<PhoneField>`. Display is customizable; the transmitted value is always E.164.
|
|
1374
1375
|
*/
|
|
1375
1376
|
phone?: PhoneConfig;
|
|
1377
|
+
/**
|
|
1378
|
+
* GAP28 / unified-goal: enable real-time on-site conversion firing. When set, the SDK
|
|
1379
|
+
* fetches the per-business config from `cdnUrl` (optional offline `baked` fallback) and
|
|
1380
|
+
* AUTOMATICALLY fires `gtag('event','conversion')` for any automatic event-goal
|
|
1381
|
+
* (scroll/time/page-view/…) whose trigger threshold a detector crosses. Omit to keep events
|
|
1382
|
+
* analytics-only. (Sale + manual-event firing lives in the server/browser sales client.)
|
|
1383
|
+
*/
|
|
1384
|
+
conversionConfig?: {
|
|
1385
|
+
cdnUrl: string;
|
|
1386
|
+
baked?: ConversionConfig | null;
|
|
1387
|
+
};
|
|
1376
1388
|
}
|
|
1377
1389
|
interface TrackingProviderProps {
|
|
1378
1390
|
/**
|
|
@@ -1472,4 +1484,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1472
1484
|
*/
|
|
1473
1485
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1474
1486
|
|
|
1475
|
-
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentState, 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 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 UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getConsentState, getEventDefinition, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, resetConsent, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, setConsentState, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
|
1487
|
+
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, 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 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 UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getConsentState, getEventDefinition, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, resetConsent, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, setConsentState, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|