@aranova/tracking-react 0.12.2 → 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 +64 -16
- package/dist/index.d.ts +64 -16
- package/dist/index.js +738 -183
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +726 -173
- package/dist/index.mjs.map +1 -1
- package/dist/{phone-utils-Du-alwyM.d.mts → phone-utils-Dyk0F14_.d.mts} +26 -1
- package/dist/{phone-utils-Du-alwyM.d.ts → phone-utils-Dyk0F14_.d.ts} +26 -1
- package/dist/phone.d.mts +1 -1
- package/dist/phone.d.ts +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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
|
|
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, P as PhoneConfig, g as ParsedPhone, h as PhoneDisplayFormat } from './phone-utils-
|
|
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-
|
|
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
|
+
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.
|
|
@@ -1228,6 +1229,35 @@ interface TypedTrackingClient<TRegistry extends TriggerRegistryConfig> {
|
|
|
1228
1229
|
getVisitorId(): string;
|
|
1229
1230
|
}
|
|
1230
1231
|
|
|
1232
|
+
/**
|
|
1233
|
+
* Props for the combined ad-platform tag loader.
|
|
1234
|
+
*
|
|
1235
|
+
* Every field is optional and independent: pass the Google fields, the Meta
|
|
1236
|
+
* fields, or both. For each platform a labelled `*Ids` map (ALL loaded) takes
|
|
1237
|
+
* precedence over the single `*Id` shortcut.
|
|
1238
|
+
*/
|
|
1239
|
+
interface AdPlatformTrackingProps {
|
|
1240
|
+
/** Single Google Ads tag id, e.g. `AW-123456789`. */
|
|
1241
|
+
gtagId?: string;
|
|
1242
|
+
/** Labelled Google Ads tag map — ALL loaded; wins over `gtagId`. */
|
|
1243
|
+
gtagIds?: GtagEnvironmentMap;
|
|
1244
|
+
/** Single Meta Pixel id, e.g. `123456789012345`. */
|
|
1245
|
+
metaPixelId?: string;
|
|
1246
|
+
/** Labelled Meta Pixel map — ALL loaded; wins over `metaPixelId`. */
|
|
1247
|
+
metaPixelIds?: MetaPixelEnvironmentMap;
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* Client component that loads the configured ad-platform tags — the Google tag
|
|
1251
|
+
* (`gtag`) and/or the Meta Pixel (`fbq`) — each with Consent Mode, and restores
|
|
1252
|
+
* stored consent. One mount handles both platforms; omit a platform's props to
|
|
1253
|
+
* skip it. Renders nothing.
|
|
1254
|
+
*
|
|
1255
|
+
* On React you usually don't need this at all — `<TrackingProvider>` already
|
|
1256
|
+
* accepts the same `gtagId/gtagIds` + `metaPixelId/metaPixelIds` props. Use this
|
|
1257
|
+
* standalone component when you want the ad tags WITHOUT the event-ingest SDK.
|
|
1258
|
+
*/
|
|
1259
|
+
declare function AdPlatformTracking({ gtagId, gtagIds, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): null;
|
|
1260
|
+
|
|
1231
1261
|
/**
|
|
1232
1262
|
* Props for the Google Ads tracking component.
|
|
1233
1263
|
*
|
|
@@ -1344,6 +1374,17 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
|
|
|
1344
1374
|
* `<PhoneField>`. Display is customizable; the transmitted value is always E.164.
|
|
1345
1375
|
*/
|
|
1346
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
|
+
};
|
|
1347
1388
|
}
|
|
1348
1389
|
interface TrackingProviderProps {
|
|
1349
1390
|
/**
|
|
@@ -1357,6 +1398,13 @@ interface TrackingProviderProps {
|
|
|
1357
1398
|
* When provided, `gtagId` is ignored.
|
|
1358
1399
|
*/
|
|
1359
1400
|
gtagIds?: GtagEnvironmentMap;
|
|
1401
|
+
/** Optional Meta Pixel id, for example `123456789012345`. */
|
|
1402
|
+
metaPixelId?: string;
|
|
1403
|
+
/**
|
|
1404
|
+
* Labelled map of Meta Pixel IDs. ALL are loaded simultaneously.
|
|
1405
|
+
* When provided, `metaPixelId` is ignored.
|
|
1406
|
+
*/
|
|
1407
|
+
metaPixelIds?: MetaPixelEnvironmentMap;
|
|
1360
1408
|
/**
|
|
1361
1409
|
* Application tree that should have access to the scoped tracking client.
|
|
1362
1410
|
*/
|
|
@@ -1436,4 +1484,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1436
1484
|
*/
|
|
1437
1485
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1438
1486
|
|
|
1439
|
-
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, 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, type ManualEventName, 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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
|
|
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, P as PhoneConfig, g as ParsedPhone, h as PhoneDisplayFormat } from './phone-utils-
|
|
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-
|
|
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
|
+
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.
|
|
@@ -1228,6 +1229,35 @@ interface TypedTrackingClient<TRegistry extends TriggerRegistryConfig> {
|
|
|
1228
1229
|
getVisitorId(): string;
|
|
1229
1230
|
}
|
|
1230
1231
|
|
|
1232
|
+
/**
|
|
1233
|
+
* Props for the combined ad-platform tag loader.
|
|
1234
|
+
*
|
|
1235
|
+
* Every field is optional and independent: pass the Google fields, the Meta
|
|
1236
|
+
* fields, or both. For each platform a labelled `*Ids` map (ALL loaded) takes
|
|
1237
|
+
* precedence over the single `*Id` shortcut.
|
|
1238
|
+
*/
|
|
1239
|
+
interface AdPlatformTrackingProps {
|
|
1240
|
+
/** Single Google Ads tag id, e.g. `AW-123456789`. */
|
|
1241
|
+
gtagId?: string;
|
|
1242
|
+
/** Labelled Google Ads tag map — ALL loaded; wins over `gtagId`. */
|
|
1243
|
+
gtagIds?: GtagEnvironmentMap;
|
|
1244
|
+
/** Single Meta Pixel id, e.g. `123456789012345`. */
|
|
1245
|
+
metaPixelId?: string;
|
|
1246
|
+
/** Labelled Meta Pixel map — ALL loaded; wins over `metaPixelId`. */
|
|
1247
|
+
metaPixelIds?: MetaPixelEnvironmentMap;
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* Client component that loads the configured ad-platform tags — the Google tag
|
|
1251
|
+
* (`gtag`) and/or the Meta Pixel (`fbq`) — each with Consent Mode, and restores
|
|
1252
|
+
* stored consent. One mount handles both platforms; omit a platform's props to
|
|
1253
|
+
* skip it. Renders nothing.
|
|
1254
|
+
*
|
|
1255
|
+
* On React you usually don't need this at all — `<TrackingProvider>` already
|
|
1256
|
+
* accepts the same `gtagId/gtagIds` + `metaPixelId/metaPixelIds` props. Use this
|
|
1257
|
+
* standalone component when you want the ad tags WITHOUT the event-ingest SDK.
|
|
1258
|
+
*/
|
|
1259
|
+
declare function AdPlatformTracking({ gtagId, gtagIds, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): null;
|
|
1260
|
+
|
|
1231
1261
|
/**
|
|
1232
1262
|
* Props for the Google Ads tracking component.
|
|
1233
1263
|
*
|
|
@@ -1344,6 +1374,17 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
|
|
|
1344
1374
|
* `<PhoneField>`. Display is customizable; the transmitted value is always E.164.
|
|
1345
1375
|
*/
|
|
1346
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
|
+
};
|
|
1347
1388
|
}
|
|
1348
1389
|
interface TrackingProviderProps {
|
|
1349
1390
|
/**
|
|
@@ -1357,6 +1398,13 @@ interface TrackingProviderProps {
|
|
|
1357
1398
|
* When provided, `gtagId` is ignored.
|
|
1358
1399
|
*/
|
|
1359
1400
|
gtagIds?: GtagEnvironmentMap;
|
|
1401
|
+
/** Optional Meta Pixel id, for example `123456789012345`. */
|
|
1402
|
+
metaPixelId?: string;
|
|
1403
|
+
/**
|
|
1404
|
+
* Labelled map of Meta Pixel IDs. ALL are loaded simultaneously.
|
|
1405
|
+
* When provided, `metaPixelId` is ignored.
|
|
1406
|
+
*/
|
|
1407
|
+
metaPixelIds?: MetaPixelEnvironmentMap;
|
|
1360
1408
|
/**
|
|
1361
1409
|
* Application tree that should have access to the scoped tracking client.
|
|
1362
1410
|
*/
|
|
@@ -1436,4 +1484,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1436
1484
|
*/
|
|
1437
1485
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1438
1486
|
|
|
1439
|
-
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, 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, type ManualEventName, 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 };
|