@aranova/tracking-next 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 +52 -16
- package/dist/index.d.ts +52 -16
- package/dist/index.js +699 -181
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +697 -181
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.js +73 -0
- package/dist/middleware.js.map +1 -1
- package/dist/middleware.mjs +73 -0
- package/dist/middleware.mjs.map +1 -1
- package/dist/{phone-utils-BVUDHwo4.d.mts → phone-utils-CcU5mwzc.d.mts} +26 -1
- package/dist/{phone-utils-BVUDHwo4.d.ts → phone-utils-CcU5mwzc.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/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +73 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +73 -0
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -228,6 +228,44 @@ npx @aranova/tracking-cli gen # reads ARANOVA_TRACKING_SECRET_KEY from
|
|
|
228
228
|
See the full guide: [sales-tracking.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/sales-tracking.md)
|
|
229
229
|
and the CLI reference: [cli.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/cli.md).
|
|
230
230
|
|
|
231
|
+
## On-site conversion firing
|
|
232
|
+
|
|
233
|
+
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**.
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
import { createTracking } from "@aranova/tracking-next";
|
|
237
|
+
import { ARANOVA_CONFIG_URL } from "./aranova-services"; // emitted by `tracking-cli gen`
|
|
238
|
+
|
|
239
|
+
export const { TrackingProvider, useTracking } = createTracking({
|
|
240
|
+
apiKey,
|
|
241
|
+
endpoint,
|
|
242
|
+
triggers,
|
|
243
|
+
conversionConfig: { cdnUrl: ARANOVA_CONFIG_URL },
|
|
244
|
+
});
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
- **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.
|
|
248
|
+
- **Sales + manual events** fire through the sales client (use a **public** key in the browser; a secret-key server-side client no-ops firing since there's no `gtag`):
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
import { createSalesClient, resolveConversionConfig, toMinor } from "@aranova/tracking-next";
|
|
252
|
+
|
|
253
|
+
const sales = createSalesClient({
|
|
254
|
+
apiKey,
|
|
255
|
+
endpoint,
|
|
256
|
+
firing: resolveConversionConfig({ cdnUrl: ARANOVA_CONFIG_URL }),
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
await sales.recordSale({
|
|
260
|
+
currency: "CAD",
|
|
261
|
+
amount_total_cents: toMinor(250, "CAD"),
|
|
262
|
+
service: "tires",
|
|
263
|
+
}); // records + fires
|
|
264
|
+
sales.trackConversion("phone_click"); // fires a manual event-goal only (no sale recorded)
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
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).
|
|
268
|
+
|
|
231
269
|
## Consent UI
|
|
232
270
|
|
|
233
271
|
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,8 +1,9 @@
|
|
|
1
|
-
import { C as ConsentState, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, T 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-
|
|
2
|
-
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-
|
|
1
|
+
import { C as ConsentState, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, T 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-CcU5mwzc.mjs';
|
|
2
|
+
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-CcU5mwzc.mjs';
|
|
3
|
+
import { C as ConversionConfig } from './sales-BsJodmh0.mjs';
|
|
4
|
+
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';
|
|
3
5
|
import { z } from 'zod';
|
|
4
6
|
import * as src from 'src';
|
|
5
|
-
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';
|
|
6
7
|
import * as react from 'react';
|
|
7
8
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
|
|
8
9
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -76,18 +77,6 @@ declare function createTrackingSessionUpsertPayload(trackingParams: TrackingPara
|
|
|
76
77
|
*/
|
|
77
78
|
declare function createTrackingEventCreatePayload(trackingParams: TrackingParams, input: TrackingEventInput, context: TrackingClientContext): TrackingEventCreatePayload;
|
|
78
79
|
|
|
79
|
-
/**
|
|
80
|
-
* Attribution query/cookie keys captured by the SDK.
|
|
81
|
-
*/
|
|
82
|
-
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
83
|
-
/**
|
|
84
|
-
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
85
|
-
* return the current cookie-backed attribution state.
|
|
86
|
-
*
|
|
87
|
-
* Defaults to `window.location.href` in the browser.
|
|
88
|
-
*/
|
|
89
|
-
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
90
|
-
|
|
91
80
|
/**
|
|
92
81
|
* Metadata for a manually fired `cta_click` event.
|
|
93
82
|
*
|
|
@@ -1120,6 +1109,18 @@ interface TrackingClient {
|
|
|
1120
1109
|
destroy: () => void;
|
|
1121
1110
|
}
|
|
1122
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* Attribution query/cookie keys captured by the SDK.
|
|
1114
|
+
*/
|
|
1115
|
+
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
1116
|
+
/**
|
|
1117
|
+
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
1118
|
+
* return the current cookie-backed attribution state.
|
|
1119
|
+
*
|
|
1120
|
+
* Defaults to `window.location.href` in the browser.
|
|
1121
|
+
*/
|
|
1122
|
+
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
1123
|
+
|
|
1123
1124
|
interface TypedTrackEventOptions {
|
|
1124
1125
|
/**
|
|
1125
1126
|
* Override the page URL associated with this event.
|
|
@@ -1285,6 +1286,31 @@ interface UseConsentResult {
|
|
|
1285
1286
|
}
|
|
1286
1287
|
declare function useConsent(): UseConsentResult;
|
|
1287
1288
|
|
|
1289
|
+
/**
|
|
1290
|
+
* Props for the combined Next.js ad-platform tag loader.
|
|
1291
|
+
*
|
|
1292
|
+
* Every field is optional and independent: pass the Google fields, the Meta
|
|
1293
|
+
* fields, or both. For each platform a labelled `*Ids` map (ALL loaded) takes
|
|
1294
|
+
* precedence over the single `*Id` shortcut.
|
|
1295
|
+
*/
|
|
1296
|
+
interface AdPlatformTrackingProps {
|
|
1297
|
+
/** Single Google Ads tag id, e.g. `AW-123456789`. */
|
|
1298
|
+
gtagId?: string;
|
|
1299
|
+
/** Labelled Google Ads tag map — ALL loaded; wins over `gtagId`. */
|
|
1300
|
+
gtagIds?: GtagEnvironmentMap;
|
|
1301
|
+
/** Single Meta Pixel id, e.g. `123456789012345`. */
|
|
1302
|
+
metaPixelId?: string;
|
|
1303
|
+
/** Labelled Meta Pixel map — ALL loaded; wins over `metaPixelId`. */
|
|
1304
|
+
metaPixelIds?: MetaPixelEnvironmentMap;
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Next.js client component that loads the configured ad-platform tags — the
|
|
1308
|
+
* Google tag (`gtag`) and/or the Meta Pixel (`fbq`) — with Consent Mode, via
|
|
1309
|
+
* `next/script`. Render once in the root layout; omit a platform's props to
|
|
1310
|
+
* skip it. Renders no visible UI.
|
|
1311
|
+
*/
|
|
1312
|
+
declare function AdPlatformTracking({ gtagId, gtagIds, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): react_jsx_runtime.JSX.Element;
|
|
1313
|
+
|
|
1288
1314
|
/**
|
|
1289
1315
|
* Props for the Next.js Google Ads tracking component.
|
|
1290
1316
|
*
|
|
@@ -1346,6 +1372,16 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
|
|
|
1346
1372
|
* `<PhoneField>`. Display is customizable; the transmitted value is always E.164.
|
|
1347
1373
|
*/
|
|
1348
1374
|
phone?: PhoneConfig;
|
|
1375
|
+
/**
|
|
1376
|
+
* GAP28 / unified-goal: enable real-time on-site conversion firing. When set, the SDK
|
|
1377
|
+
* fetches the per-business config from `cdnUrl` (optional offline `baked` fallback) and
|
|
1378
|
+
* AUTOMATICALLY fires `gtag('event','conversion')` for any automatic event-goal whose
|
|
1379
|
+
* trigger threshold a detector crosses. Omit to keep events analytics-only.
|
|
1380
|
+
*/
|
|
1381
|
+
conversionConfig?: {
|
|
1382
|
+
cdnUrl: string;
|
|
1383
|
+
baked?: ConversionConfig | null;
|
|
1384
|
+
};
|
|
1349
1385
|
}
|
|
1350
1386
|
interface TrackingProviderProps {
|
|
1351
1387
|
/**
|
|
@@ -1434,4 +1470,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1434
1470
|
*/
|
|
1435
1471
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1436
1472
|
|
|
1437
|
-
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 };
|
|
1473
|
+
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,8 +1,9 @@
|
|
|
1
|
-
import { C as ConsentState, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, T 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-
|
|
2
|
-
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-
|
|
1
|
+
import { C as ConsentState, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, T 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-CcU5mwzc.js';
|
|
2
|
+
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-CcU5mwzc.js';
|
|
3
|
+
import { C as ConversionConfig } from './sales-BsJodmh0.js';
|
|
4
|
+
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';
|
|
3
5
|
import { z } from 'zod';
|
|
4
6
|
import * as src from 'src';
|
|
5
|
-
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';
|
|
6
7
|
import * as react from 'react';
|
|
7
8
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
|
|
8
9
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -76,18 +77,6 @@ declare function createTrackingSessionUpsertPayload(trackingParams: TrackingPara
|
|
|
76
77
|
*/
|
|
77
78
|
declare function createTrackingEventCreatePayload(trackingParams: TrackingParams, input: TrackingEventInput, context: TrackingClientContext): TrackingEventCreatePayload;
|
|
78
79
|
|
|
79
|
-
/**
|
|
80
|
-
* Attribution query/cookie keys captured by the SDK.
|
|
81
|
-
*/
|
|
82
|
-
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
83
|
-
/**
|
|
84
|
-
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
85
|
-
* return the current cookie-backed attribution state.
|
|
86
|
-
*
|
|
87
|
-
* Defaults to `window.location.href` in the browser.
|
|
88
|
-
*/
|
|
89
|
-
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
90
|
-
|
|
91
80
|
/**
|
|
92
81
|
* Metadata for a manually fired `cta_click` event.
|
|
93
82
|
*
|
|
@@ -1120,6 +1109,18 @@ interface TrackingClient {
|
|
|
1120
1109
|
destroy: () => void;
|
|
1121
1110
|
}
|
|
1122
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* Attribution query/cookie keys captured by the SDK.
|
|
1114
|
+
*/
|
|
1115
|
+
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
1116
|
+
/**
|
|
1117
|
+
* Capture tracking params from a URL, persist them to first-party cookies, and
|
|
1118
|
+
* return the current cookie-backed attribution state.
|
|
1119
|
+
*
|
|
1120
|
+
* Defaults to `window.location.href` in the browser.
|
|
1121
|
+
*/
|
|
1122
|
+
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
1123
|
+
|
|
1123
1124
|
interface TypedTrackEventOptions {
|
|
1124
1125
|
/**
|
|
1125
1126
|
* Override the page URL associated with this event.
|
|
@@ -1285,6 +1286,31 @@ interface UseConsentResult {
|
|
|
1285
1286
|
}
|
|
1286
1287
|
declare function useConsent(): UseConsentResult;
|
|
1287
1288
|
|
|
1289
|
+
/**
|
|
1290
|
+
* Props for the combined Next.js ad-platform tag loader.
|
|
1291
|
+
*
|
|
1292
|
+
* Every field is optional and independent: pass the Google fields, the Meta
|
|
1293
|
+
* fields, or both. For each platform a labelled `*Ids` map (ALL loaded) takes
|
|
1294
|
+
* precedence over the single `*Id` shortcut.
|
|
1295
|
+
*/
|
|
1296
|
+
interface AdPlatformTrackingProps {
|
|
1297
|
+
/** Single Google Ads tag id, e.g. `AW-123456789`. */
|
|
1298
|
+
gtagId?: string;
|
|
1299
|
+
/** Labelled Google Ads tag map — ALL loaded; wins over `gtagId`. */
|
|
1300
|
+
gtagIds?: GtagEnvironmentMap;
|
|
1301
|
+
/** Single Meta Pixel id, e.g. `123456789012345`. */
|
|
1302
|
+
metaPixelId?: string;
|
|
1303
|
+
/** Labelled Meta Pixel map — ALL loaded; wins over `metaPixelId`. */
|
|
1304
|
+
metaPixelIds?: MetaPixelEnvironmentMap;
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Next.js client component that loads the configured ad-platform tags — the
|
|
1308
|
+
* Google tag (`gtag`) and/or the Meta Pixel (`fbq`) — with Consent Mode, via
|
|
1309
|
+
* `next/script`. Render once in the root layout; omit a platform's props to
|
|
1310
|
+
* skip it. Renders no visible UI.
|
|
1311
|
+
*/
|
|
1312
|
+
declare function AdPlatformTracking({ gtagId, gtagIds, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): react_jsx_runtime.JSX.Element;
|
|
1313
|
+
|
|
1288
1314
|
/**
|
|
1289
1315
|
* Props for the Next.js Google Ads tracking component.
|
|
1290
1316
|
*
|
|
@@ -1346,6 +1372,16 @@ interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
|
|
|
1346
1372
|
* `<PhoneField>`. Display is customizable; the transmitted value is always E.164.
|
|
1347
1373
|
*/
|
|
1348
1374
|
phone?: PhoneConfig;
|
|
1375
|
+
/**
|
|
1376
|
+
* GAP28 / unified-goal: enable real-time on-site conversion firing. When set, the SDK
|
|
1377
|
+
* fetches the per-business config from `cdnUrl` (optional offline `baked` fallback) and
|
|
1378
|
+
* AUTOMATICALLY fires `gtag('event','conversion')` for any automatic event-goal whose
|
|
1379
|
+
* trigger threshold a detector crosses. Omit to keep events analytics-only.
|
|
1380
|
+
*/
|
|
1381
|
+
conversionConfig?: {
|
|
1382
|
+
cdnUrl: string;
|
|
1383
|
+
baked?: ConversionConfig | null;
|
|
1384
|
+
};
|
|
1349
1385
|
}
|
|
1350
1386
|
interface TrackingProviderProps {
|
|
1351
1387
|
/**
|
|
@@ -1434,4 +1470,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1434
1470
|
*/
|
|
1435
1471
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1436
1472
|
|
|
1437
|
-
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 };
|
|
1473
|
+
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 };
|