@aranova/tracking-react 0.5.0 → 0.6.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 +114 -0
- package/dist/index.d.mts +194 -112
- package/dist/index.d.ts +194 -112
- package/dist/index.js +178 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +178 -73
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import * as src from 'src';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
declare function ConsentBanner(): react_jsx_runtime.JSX.Element | null;
|
|
@@ -105,82 +106,11 @@ declare function createTrackingEventCreatePayload(trackingParams: TrackingParams
|
|
|
105
106
|
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
106
107
|
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
107
108
|
|
|
108
|
-
interface TrackEventInput {
|
|
109
|
-
eventType: string;
|
|
110
|
-
pageUrl?: string | null;
|
|
111
|
-
metadata?: Record<string, unknown> | null;
|
|
112
|
-
occurredAt?: Date | string | null;
|
|
113
|
-
}
|
|
114
|
-
interface TrackingClient {
|
|
115
|
-
trackEvent: (input: TrackEventInput) => void;
|
|
116
|
-
flush: () => Promise<void>;
|
|
117
|
-
getSessionId: () => string;
|
|
118
|
-
getVisitorId: () => string;
|
|
119
|
-
destroy: () => void;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
declare const pageViewMetadataSchema: z.ZodObject<{
|
|
123
|
-
page: z.ZodObject<{
|
|
124
|
-
title: z.ZodNullable<z.ZodString>;
|
|
125
|
-
path: z.ZodString;
|
|
126
|
-
search: z.ZodString;
|
|
127
|
-
hash: z.ZodString;
|
|
128
|
-
}, "strip", z.ZodTypeAny, {
|
|
129
|
-
search: string;
|
|
130
|
-
title: string | null;
|
|
131
|
-
path: string;
|
|
132
|
-
hash: string;
|
|
133
|
-
}, {
|
|
134
|
-
search: string;
|
|
135
|
-
title: string | null;
|
|
136
|
-
path: string;
|
|
137
|
-
hash: string;
|
|
138
|
-
}>;
|
|
139
|
-
referrer: z.ZodNullable<z.ZodString>;
|
|
140
|
-
viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
141
|
-
w: z.ZodNumber;
|
|
142
|
-
h: z.ZodNumber;
|
|
143
|
-
}, "strip", z.ZodTypeAny, {
|
|
144
|
-
w: number;
|
|
145
|
-
h: number;
|
|
146
|
-
}, {
|
|
147
|
-
w: number;
|
|
148
|
-
h: number;
|
|
149
|
-
}>>>;
|
|
150
|
-
}, "strict", z.ZodTypeAny, {
|
|
151
|
-
page: {
|
|
152
|
-
search: string;
|
|
153
|
-
title: string | null;
|
|
154
|
-
path: string;
|
|
155
|
-
hash: string;
|
|
156
|
-
};
|
|
157
|
-
referrer: string | null;
|
|
158
|
-
viewport?: {
|
|
159
|
-
w: number;
|
|
160
|
-
h: number;
|
|
161
|
-
} | null | undefined;
|
|
162
|
-
}, {
|
|
163
|
-
page: {
|
|
164
|
-
search: string;
|
|
165
|
-
title: string | null;
|
|
166
|
-
path: string;
|
|
167
|
-
hash: string;
|
|
168
|
-
};
|
|
169
|
-
referrer: string | null;
|
|
170
|
-
viewport?: {
|
|
171
|
-
w: number;
|
|
172
|
-
h: number;
|
|
173
|
-
} | null | undefined;
|
|
174
|
-
}>;
|
|
175
|
-
type PageViewMetadata = z.infer<typeof pageViewMetadataSchema>;
|
|
176
|
-
declare const pageViewConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
177
|
-
type PageViewConfig = z.infer<typeof pageViewConfigSchema>;
|
|
178
|
-
|
|
179
109
|
declare const ctaClickMetadataSchema: z.ZodObject<{
|
|
180
110
|
cta_name: z.ZodString;
|
|
181
111
|
page: z.ZodObject<{
|
|
182
112
|
path: z.ZodString;
|
|
183
|
-
}, "
|
|
113
|
+
}, "strict", z.ZodTypeAny, {
|
|
184
114
|
path: string;
|
|
185
115
|
}, {
|
|
186
116
|
path: string;
|
|
@@ -206,11 +136,49 @@ type CtaClickMetadata = z.infer<typeof ctaClickMetadataSchema>;
|
|
|
206
136
|
declare const ctaClickConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
207
137
|
type CtaClickConfig = z.infer<typeof ctaClickConfigSchema>;
|
|
208
138
|
|
|
139
|
+
declare const sdkHeartbeatMetadataSchema: z.ZodObject<{
|
|
140
|
+
sdk_version: z.ZodString;
|
|
141
|
+
package_name: z.ZodNullable<z.ZodString>;
|
|
142
|
+
surface: z.ZodEnum<["next", "react", "script"]>;
|
|
143
|
+
triggers: z.ZodObject<{
|
|
144
|
+
automatic: z.ZodArray<z.ZodString, "many">;
|
|
145
|
+
manual: z.ZodArray<z.ZodString, "many">;
|
|
146
|
+
}, "strict", z.ZodTypeAny, {
|
|
147
|
+
automatic: string[];
|
|
148
|
+
manual: string[];
|
|
149
|
+
}, {
|
|
150
|
+
automatic: string[];
|
|
151
|
+
manual: string[];
|
|
152
|
+
}>;
|
|
153
|
+
trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
154
|
+
}, "strict", z.ZodTypeAny, {
|
|
155
|
+
sdk_version: string;
|
|
156
|
+
package_name: string | null;
|
|
157
|
+
surface: "next" | "react" | "script";
|
|
158
|
+
triggers: {
|
|
159
|
+
automatic: string[];
|
|
160
|
+
manual: string[];
|
|
161
|
+
};
|
|
162
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
163
|
+
}, {
|
|
164
|
+
sdk_version: string;
|
|
165
|
+
package_name: string | null;
|
|
166
|
+
surface: "next" | "react" | "script";
|
|
167
|
+
triggers: {
|
|
168
|
+
automatic: string[];
|
|
169
|
+
manual: string[];
|
|
170
|
+
};
|
|
171
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
172
|
+
}>;
|
|
173
|
+
type SdkHeartbeatMetadata = z.infer<typeof sdkHeartbeatMetadataSchema>;
|
|
174
|
+
declare const sdkHeartbeatConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
175
|
+
type SdkHeartbeatConfig = z.infer<typeof sdkHeartbeatConfigSchema>;
|
|
176
|
+
|
|
209
177
|
declare const formStartMetadataSchema: z.ZodObject<{
|
|
210
178
|
form: z.ZodObject<{
|
|
211
179
|
id: z.ZodString;
|
|
212
180
|
action: z.ZodNullable<z.ZodString>;
|
|
213
|
-
}, "
|
|
181
|
+
}, "strict", z.ZodTypeAny, {
|
|
214
182
|
id: string;
|
|
215
183
|
action: string | null;
|
|
216
184
|
}, {
|
|
@@ -219,7 +187,7 @@ declare const formStartMetadataSchema: z.ZodObject<{
|
|
|
219
187
|
}>;
|
|
220
188
|
page: z.ZodObject<{
|
|
221
189
|
path: z.ZodString;
|
|
222
|
-
}, "
|
|
190
|
+
}, "strict", z.ZodTypeAny, {
|
|
223
191
|
path: string;
|
|
224
192
|
}, {
|
|
225
193
|
path: string;
|
|
@@ -251,6 +219,9 @@ declare const formStartConfigSchema: z.ZodObject<{
|
|
|
251
219
|
}>;
|
|
252
220
|
type FormStartConfig = z.infer<typeof formStartConfigSchema>;
|
|
253
221
|
|
|
222
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
223
|
+
[key: string]: JsonValue;
|
|
224
|
+
};
|
|
254
225
|
declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
255
226
|
form: z.ZodObject<{
|
|
256
227
|
id: z.ZodString;
|
|
@@ -259,40 +230,40 @@ declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
|
259
230
|
name: z.ZodString;
|
|
260
231
|
type: z.ZodString;
|
|
261
232
|
label: z.ZodNullable<z.ZodString>;
|
|
262
|
-
|
|
263
|
-
}, "
|
|
233
|
+
value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>;
|
|
234
|
+
}, "strict", z.ZodTypeAny, {
|
|
264
235
|
label: string | null;
|
|
236
|
+
value: JsonValue;
|
|
265
237
|
type: string;
|
|
266
238
|
name: string;
|
|
267
|
-
has_value: boolean;
|
|
268
239
|
}, {
|
|
269
240
|
label: string | null;
|
|
241
|
+
value: JsonValue;
|
|
270
242
|
type: string;
|
|
271
243
|
name: string;
|
|
272
|
-
has_value: boolean;
|
|
273
244
|
}>, "many">>;
|
|
274
|
-
}, "
|
|
245
|
+
}, "strict", z.ZodTypeAny, {
|
|
275
246
|
id: string;
|
|
276
247
|
action: string | null;
|
|
277
248
|
fields?: {
|
|
278
249
|
label: string | null;
|
|
250
|
+
value: JsonValue;
|
|
279
251
|
type: string;
|
|
280
252
|
name: string;
|
|
281
|
-
has_value: boolean;
|
|
282
253
|
}[] | undefined;
|
|
283
254
|
}, {
|
|
284
255
|
id: string;
|
|
285
256
|
action: string | null;
|
|
286
257
|
fields?: {
|
|
287
258
|
label: string | null;
|
|
259
|
+
value: JsonValue;
|
|
288
260
|
type: string;
|
|
289
261
|
name: string;
|
|
290
|
-
has_value: boolean;
|
|
291
262
|
}[] | undefined;
|
|
292
263
|
}>;
|
|
293
264
|
page: z.ZodObject<{
|
|
294
265
|
path: z.ZodString;
|
|
295
|
-
}, "
|
|
266
|
+
}, "strict", z.ZodTypeAny, {
|
|
296
267
|
path: string;
|
|
297
268
|
}, {
|
|
298
269
|
path: string;
|
|
@@ -303,9 +274,9 @@ declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
|
303
274
|
action: string | null;
|
|
304
275
|
fields?: {
|
|
305
276
|
label: string | null;
|
|
277
|
+
value: JsonValue;
|
|
306
278
|
type: string;
|
|
307
279
|
name: string;
|
|
308
|
-
has_value: boolean;
|
|
309
280
|
}[] | undefined;
|
|
310
281
|
};
|
|
311
282
|
page: {
|
|
@@ -317,9 +288,9 @@ declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
|
317
288
|
action: string | null;
|
|
318
289
|
fields?: {
|
|
319
290
|
label: string | null;
|
|
291
|
+
value: JsonValue;
|
|
320
292
|
type: string;
|
|
321
293
|
name: string;
|
|
322
|
-
has_value: boolean;
|
|
323
294
|
}[] | undefined;
|
|
324
295
|
};
|
|
325
296
|
page: {
|
|
@@ -334,7 +305,7 @@ declare const multiPageSessionMetadataSchema: z.ZodObject<{
|
|
|
334
305
|
page_count: z.ZodNumber;
|
|
335
306
|
page: z.ZodObject<{
|
|
336
307
|
path: z.ZodString;
|
|
337
|
-
}, "
|
|
308
|
+
}, "strict", z.ZodTypeAny, {
|
|
338
309
|
path: string;
|
|
339
310
|
}, {
|
|
340
311
|
path: string;
|
|
@@ -360,11 +331,68 @@ declare const multiPageSessionConfigSchema: z.ZodObject<{
|
|
|
360
331
|
}>;
|
|
361
332
|
type MultiPageSessionConfig = z.infer<typeof multiPageSessionConfigSchema>;
|
|
362
333
|
|
|
334
|
+
declare const pageViewMetadataSchema: z.ZodObject<{
|
|
335
|
+
page: z.ZodObject<{
|
|
336
|
+
title: z.ZodNullable<z.ZodString>;
|
|
337
|
+
path: z.ZodString;
|
|
338
|
+
search: z.ZodString;
|
|
339
|
+
hash: z.ZodString;
|
|
340
|
+
}, "strict", z.ZodTypeAny, {
|
|
341
|
+
search: string;
|
|
342
|
+
title: string | null;
|
|
343
|
+
path: string;
|
|
344
|
+
hash: string;
|
|
345
|
+
}, {
|
|
346
|
+
search: string;
|
|
347
|
+
title: string | null;
|
|
348
|
+
path: string;
|
|
349
|
+
hash: string;
|
|
350
|
+
}>;
|
|
351
|
+
referrer: z.ZodNullable<z.ZodString>;
|
|
352
|
+
viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
353
|
+
w: z.ZodNumber;
|
|
354
|
+
h: z.ZodNumber;
|
|
355
|
+
}, "strict", z.ZodTypeAny, {
|
|
356
|
+
w: number;
|
|
357
|
+
h: number;
|
|
358
|
+
}, {
|
|
359
|
+
w: number;
|
|
360
|
+
h: number;
|
|
361
|
+
}>>>;
|
|
362
|
+
}, "strict", z.ZodTypeAny, {
|
|
363
|
+
page: {
|
|
364
|
+
search: string;
|
|
365
|
+
title: string | null;
|
|
366
|
+
path: string;
|
|
367
|
+
hash: string;
|
|
368
|
+
};
|
|
369
|
+
referrer: string | null;
|
|
370
|
+
viewport?: {
|
|
371
|
+
w: number;
|
|
372
|
+
h: number;
|
|
373
|
+
} | null | undefined;
|
|
374
|
+
}, {
|
|
375
|
+
page: {
|
|
376
|
+
search: string;
|
|
377
|
+
title: string | null;
|
|
378
|
+
path: string;
|
|
379
|
+
hash: string;
|
|
380
|
+
};
|
|
381
|
+
referrer: string | null;
|
|
382
|
+
viewport?: {
|
|
383
|
+
w: number;
|
|
384
|
+
h: number;
|
|
385
|
+
} | null | undefined;
|
|
386
|
+
}>;
|
|
387
|
+
type PageViewMetadata = z.infer<typeof pageViewMetadataSchema>;
|
|
388
|
+
declare const pageViewConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
389
|
+
type PageViewConfig = z.infer<typeof pageViewConfigSchema>;
|
|
390
|
+
|
|
363
391
|
declare const phoneClickMetadataSchema: z.ZodObject<{
|
|
364
392
|
phone_number: z.ZodString;
|
|
365
393
|
page: z.ZodObject<{
|
|
366
394
|
path: z.ZodString;
|
|
367
|
-
}, "
|
|
395
|
+
}, "strict", z.ZodTypeAny, {
|
|
368
396
|
path: string;
|
|
369
397
|
}, {
|
|
370
398
|
path: string;
|
|
@@ -391,7 +419,7 @@ declare const scrollDepthMetadataSchema: z.ZodObject<{
|
|
|
391
419
|
depth_percent: z.ZodNumber;
|
|
392
420
|
page: z.ZodObject<{
|
|
393
421
|
path: z.ZodString;
|
|
394
|
-
}, "
|
|
422
|
+
}, "strict", z.ZodTypeAny, {
|
|
395
423
|
path: string;
|
|
396
424
|
}, {
|
|
397
425
|
path: string;
|
|
@@ -423,7 +451,7 @@ declare const specificPageVisitMetadataSchema: z.ZodObject<{
|
|
|
423
451
|
page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
424
452
|
page: z.ZodObject<{
|
|
425
453
|
path: z.ZodString;
|
|
426
|
-
}, "
|
|
454
|
+
}, "strict", z.ZodTypeAny, {
|
|
427
455
|
path: string;
|
|
428
456
|
}, {
|
|
429
457
|
path: string;
|
|
@@ -444,7 +472,7 @@ declare const specificPageVisitConfigSchema: z.ZodObject<{
|
|
|
444
472
|
pages: z.ZodArray<z.ZodObject<{
|
|
445
473
|
name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
446
474
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
447
|
-
}, "
|
|
475
|
+
}, "strict", z.ZodTypeAny, {
|
|
448
476
|
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
449
477
|
pathPattern: RegExp;
|
|
450
478
|
}, {
|
|
@@ -468,7 +496,7 @@ declare const timeOnSiteMetadataSchema: z.ZodObject<{
|
|
|
468
496
|
duration_ms: z.ZodNumber;
|
|
469
497
|
page: z.ZodObject<{
|
|
470
498
|
path: z.ZodString;
|
|
471
|
-
}, "
|
|
499
|
+
}, "strict", z.ZodTypeAny, {
|
|
472
500
|
path: string;
|
|
473
501
|
}, {
|
|
474
502
|
path: string;
|
|
@@ -503,7 +531,7 @@ declare const EVENT_REGISTRY: {
|
|
|
503
531
|
path: z.ZodString;
|
|
504
532
|
search: z.ZodString;
|
|
505
533
|
hash: z.ZodString;
|
|
506
|
-
}, "
|
|
534
|
+
}, "strict", z.ZodTypeAny, {
|
|
507
535
|
search: string;
|
|
508
536
|
title: string | null;
|
|
509
537
|
path: string;
|
|
@@ -518,7 +546,7 @@ declare const EVENT_REGISTRY: {
|
|
|
518
546
|
viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
519
547
|
w: z.ZodNumber;
|
|
520
548
|
h: z.ZodNumber;
|
|
521
|
-
}, "
|
|
549
|
+
}, "strict", z.ZodTypeAny, {
|
|
522
550
|
w: number;
|
|
523
551
|
h: number;
|
|
524
552
|
}, {
|
|
@@ -558,7 +586,7 @@ declare const EVENT_REGISTRY: {
|
|
|
558
586
|
duration_ms: z.ZodNumber;
|
|
559
587
|
page: z.ZodObject<{
|
|
560
588
|
path: z.ZodString;
|
|
561
|
-
}, "
|
|
589
|
+
}, "strict", z.ZodTypeAny, {
|
|
562
590
|
path: string;
|
|
563
591
|
}, {
|
|
564
592
|
path: string;
|
|
@@ -588,7 +616,7 @@ declare const EVENT_REGISTRY: {
|
|
|
588
616
|
page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
589
617
|
page: z.ZodObject<{
|
|
590
618
|
path: z.ZodString;
|
|
591
|
-
}, "
|
|
619
|
+
}, "strict", z.ZodTypeAny, {
|
|
592
620
|
path: string;
|
|
593
621
|
}, {
|
|
594
622
|
path: string;
|
|
@@ -608,7 +636,7 @@ declare const EVENT_REGISTRY: {
|
|
|
608
636
|
pages: z.ZodArray<z.ZodObject<{
|
|
609
637
|
name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
610
638
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
611
|
-
}, "
|
|
639
|
+
}, "strict", z.ZodTypeAny, {
|
|
612
640
|
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
613
641
|
pathPattern: RegExp;
|
|
614
642
|
}, {
|
|
@@ -633,7 +661,7 @@ declare const EVENT_REGISTRY: {
|
|
|
633
661
|
depth_percent: z.ZodNumber;
|
|
634
662
|
page: z.ZodObject<{
|
|
635
663
|
path: z.ZodString;
|
|
636
|
-
}, "
|
|
664
|
+
}, "strict", z.ZodTypeAny, {
|
|
637
665
|
path: string;
|
|
638
666
|
}, {
|
|
639
667
|
path: string;
|
|
@@ -663,7 +691,7 @@ declare const EVENT_REGISTRY: {
|
|
|
663
691
|
page_count: z.ZodNumber;
|
|
664
692
|
page: z.ZodObject<{
|
|
665
693
|
path: z.ZodString;
|
|
666
|
-
}, "
|
|
694
|
+
}, "strict", z.ZodTypeAny, {
|
|
667
695
|
path: string;
|
|
668
696
|
}, {
|
|
669
697
|
path: string;
|
|
@@ -693,7 +721,7 @@ declare const EVENT_REGISTRY: {
|
|
|
693
721
|
form: z.ZodObject<{
|
|
694
722
|
id: z.ZodString;
|
|
695
723
|
action: z.ZodNullable<z.ZodString>;
|
|
696
|
-
}, "
|
|
724
|
+
}, "strict", z.ZodTypeAny, {
|
|
697
725
|
id: string;
|
|
698
726
|
action: string | null;
|
|
699
727
|
}, {
|
|
@@ -702,7 +730,7 @@ declare const EVENT_REGISTRY: {
|
|
|
702
730
|
}>;
|
|
703
731
|
page: z.ZodObject<{
|
|
704
732
|
path: z.ZodString;
|
|
705
|
-
}, "
|
|
733
|
+
}, "strict", z.ZodTypeAny, {
|
|
706
734
|
path: string;
|
|
707
735
|
}, {
|
|
708
736
|
path: string;
|
|
@@ -732,6 +760,44 @@ declare const EVENT_REGISTRY: {
|
|
|
732
760
|
selector?: string | undefined;
|
|
733
761
|
}>;
|
|
734
762
|
};
|
|
763
|
+
readonly sdk_heartbeat: {
|
|
764
|
+
readonly kind: "automatic";
|
|
765
|
+
readonly metadataSchema: z.ZodObject<{
|
|
766
|
+
sdk_version: z.ZodString;
|
|
767
|
+
package_name: z.ZodNullable<z.ZodString>;
|
|
768
|
+
surface: z.ZodEnum<["next", "react", "script"]>;
|
|
769
|
+
triggers: z.ZodObject<{
|
|
770
|
+
automatic: z.ZodArray<z.ZodString, "many">;
|
|
771
|
+
manual: z.ZodArray<z.ZodString, "many">;
|
|
772
|
+
}, "strict", z.ZodTypeAny, {
|
|
773
|
+
automatic: string[];
|
|
774
|
+
manual: string[];
|
|
775
|
+
}, {
|
|
776
|
+
automatic: string[];
|
|
777
|
+
manual: string[];
|
|
778
|
+
}>;
|
|
779
|
+
trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
780
|
+
}, "strict", z.ZodTypeAny, {
|
|
781
|
+
sdk_version: string;
|
|
782
|
+
package_name: string | null;
|
|
783
|
+
surface: "next" | "react" | "script";
|
|
784
|
+
triggers: {
|
|
785
|
+
automatic: string[];
|
|
786
|
+
manual: string[];
|
|
787
|
+
};
|
|
788
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
789
|
+
}, {
|
|
790
|
+
sdk_version: string;
|
|
791
|
+
package_name: string | null;
|
|
792
|
+
surface: "next" | "react" | "script";
|
|
793
|
+
triggers: {
|
|
794
|
+
automatic: string[];
|
|
795
|
+
manual: string[];
|
|
796
|
+
};
|
|
797
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
798
|
+
}>;
|
|
799
|
+
readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
800
|
+
};
|
|
735
801
|
readonly form_submit: {
|
|
736
802
|
readonly kind: "manual";
|
|
737
803
|
readonly metadataSchema: z.ZodObject<{
|
|
@@ -742,40 +808,40 @@ declare const EVENT_REGISTRY: {
|
|
|
742
808
|
name: z.ZodString;
|
|
743
809
|
type: z.ZodString;
|
|
744
810
|
label: z.ZodNullable<z.ZodString>;
|
|
745
|
-
|
|
746
|
-
}, "
|
|
811
|
+
value: z.ZodType<src.JsonValue, z.ZodTypeDef, src.JsonValue>;
|
|
812
|
+
}, "strict", z.ZodTypeAny, {
|
|
747
813
|
label: string | null;
|
|
814
|
+
value: src.JsonValue;
|
|
748
815
|
type: string;
|
|
749
816
|
name: string;
|
|
750
|
-
has_value: boolean;
|
|
751
817
|
}, {
|
|
752
818
|
label: string | null;
|
|
819
|
+
value: src.JsonValue;
|
|
753
820
|
type: string;
|
|
754
821
|
name: string;
|
|
755
|
-
has_value: boolean;
|
|
756
822
|
}>, "many">>;
|
|
757
|
-
}, "
|
|
823
|
+
}, "strict", z.ZodTypeAny, {
|
|
758
824
|
id: string;
|
|
759
825
|
action: string | null;
|
|
760
826
|
fields?: {
|
|
761
827
|
label: string | null;
|
|
828
|
+
value: src.JsonValue;
|
|
762
829
|
type: string;
|
|
763
830
|
name: string;
|
|
764
|
-
has_value: boolean;
|
|
765
831
|
}[] | undefined;
|
|
766
832
|
}, {
|
|
767
833
|
id: string;
|
|
768
834
|
action: string | null;
|
|
769
835
|
fields?: {
|
|
770
836
|
label: string | null;
|
|
837
|
+
value: src.JsonValue;
|
|
771
838
|
type: string;
|
|
772
839
|
name: string;
|
|
773
|
-
has_value: boolean;
|
|
774
840
|
}[] | undefined;
|
|
775
841
|
}>;
|
|
776
842
|
page: z.ZodObject<{
|
|
777
843
|
path: z.ZodString;
|
|
778
|
-
}, "
|
|
844
|
+
}, "strict", z.ZodTypeAny, {
|
|
779
845
|
path: string;
|
|
780
846
|
}, {
|
|
781
847
|
path: string;
|
|
@@ -786,9 +852,9 @@ declare const EVENT_REGISTRY: {
|
|
|
786
852
|
action: string | null;
|
|
787
853
|
fields?: {
|
|
788
854
|
label: string | null;
|
|
855
|
+
value: src.JsonValue;
|
|
789
856
|
type: string;
|
|
790
857
|
name: string;
|
|
791
|
-
has_value: boolean;
|
|
792
858
|
}[] | undefined;
|
|
793
859
|
};
|
|
794
860
|
page: {
|
|
@@ -800,9 +866,9 @@ declare const EVENT_REGISTRY: {
|
|
|
800
866
|
action: string | null;
|
|
801
867
|
fields?: {
|
|
802
868
|
label: string | null;
|
|
869
|
+
value: src.JsonValue;
|
|
803
870
|
type: string;
|
|
804
871
|
name: string;
|
|
805
|
-
has_value: boolean;
|
|
806
872
|
}[] | undefined;
|
|
807
873
|
};
|
|
808
874
|
page: {
|
|
@@ -817,7 +883,7 @@ declare const EVENT_REGISTRY: {
|
|
|
817
883
|
phone_number: z.ZodString;
|
|
818
884
|
page: z.ZodObject<{
|
|
819
885
|
path: z.ZodString;
|
|
820
|
-
}, "
|
|
886
|
+
}, "strict", z.ZodTypeAny, {
|
|
821
887
|
path: string;
|
|
822
888
|
}, {
|
|
823
889
|
path: string;
|
|
@@ -844,7 +910,7 @@ declare const EVENT_REGISTRY: {
|
|
|
844
910
|
cta_name: z.ZodString;
|
|
845
911
|
page: z.ZodObject<{
|
|
846
912
|
path: z.ZodString;
|
|
847
|
-
}, "
|
|
913
|
+
}, "strict", z.ZodTypeAny, {
|
|
848
914
|
path: string;
|
|
849
915
|
}, {
|
|
850
916
|
path: string;
|
|
@@ -883,6 +949,7 @@ type MetadataByName = {
|
|
|
883
949
|
scroll_depth: ScrollDepthMetadata;
|
|
884
950
|
multi_page_session: MultiPageSessionMetadata;
|
|
885
951
|
form_start: FormStartMetadata;
|
|
952
|
+
sdk_heartbeat: SdkHeartbeatMetadata;
|
|
886
953
|
form_submit: FormSubmitMetadata;
|
|
887
954
|
phone_click: PhoneClickMetadata;
|
|
888
955
|
cta_click: CtaClickMetadata;
|
|
@@ -894,6 +961,7 @@ type ConfigByName = {
|
|
|
894
961
|
scroll_depth: ScrollDepthConfig;
|
|
895
962
|
multi_page_session: MultiPageSessionConfig;
|
|
896
963
|
form_start: FormStartConfig;
|
|
964
|
+
sdk_heartbeat: SdkHeartbeatConfig;
|
|
897
965
|
form_submit: FormSubmitConfig;
|
|
898
966
|
phone_click: PhoneClickConfig;
|
|
899
967
|
cta_click: CtaClickConfig;
|
|
@@ -919,6 +987,20 @@ type TriggerRegistryConfig = {
|
|
|
919
987
|
type RegisteredManualEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof NonNullable<TRegistry['manual']>, ManualEventName>;
|
|
920
988
|
type RegisteredAutomaticEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof TRegistry['automatic'], AutomaticEventName>;
|
|
921
989
|
|
|
990
|
+
interface TrackEventInput {
|
|
991
|
+
eventType: string;
|
|
992
|
+
pageUrl?: string | null;
|
|
993
|
+
metadata?: Record<string, unknown> | null;
|
|
994
|
+
occurredAt?: Date | string | null;
|
|
995
|
+
}
|
|
996
|
+
interface TrackingClient {
|
|
997
|
+
trackEvent: (input: TrackEventInput) => void;
|
|
998
|
+
flush: () => Promise<void>;
|
|
999
|
+
getSessionId: () => string;
|
|
1000
|
+
getVisitorId: () => string;
|
|
1001
|
+
destroy: () => void;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
922
1004
|
interface TypedTrackEventOptions {
|
|
923
1005
|
/** Override the page URL captured automatically. Rarely needed. */
|
|
924
1006
|
pageUrl?: string | null;
|
|
@@ -970,4 +1052,4 @@ interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
|
|
|
970
1052
|
}
|
|
971
1053
|
declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
|
|
972
1054
|
|
|
973
|
-
export { type AutomaticEventName, ConsentBanner, type ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type RegisteredAutomaticEvents, type RegisteredManualEvents, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, type TrackingClientContext, type TrackingEventCreatePayload, type TrackingInitConfig, type TrackingInstallSurface, type TrackingParams, type TrackingProviderProps, type TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, getConsentState, setConsentState, useConsentState, useGclid, useTrackingParams };
|
|
1055
|
+
export { type AutomaticEventName, ConsentBanner, type ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type JsonValue, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type RegisteredAutomaticEvents, type RegisteredManualEvents, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, type TrackingClientContext, type TrackingEventCreatePayload, type TrackingInitConfig, type TrackingInstallSurface, type TrackingParams, type TrackingProviderProps, type TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, getConsentState, setConsentState, useConsentState, useGclid, useTrackingParams };
|