@aranova/tracking-react 0.4.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +544 -100
- package/dist/index.d.ts +544 -100
- package/dist/index.js +486 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +486 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -105,19 +105,227 @@ declare function createTrackingEventCreatePayload(trackingParams: TrackingParams
|
|
|
105
105
|
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
106
106
|
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
108
|
+
declare const ctaClickMetadataSchema: z.ZodObject<{
|
|
109
|
+
cta_name: z.ZodString;
|
|
110
|
+
page: z.ZodObject<{
|
|
111
|
+
path: z.ZodString;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
path: string;
|
|
114
|
+
}, {
|
|
115
|
+
path: string;
|
|
116
|
+
}>;
|
|
117
|
+
section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
+
destination_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
|
+
}, "strict", z.ZodTypeAny, {
|
|
120
|
+
page: {
|
|
121
|
+
path: string;
|
|
122
|
+
};
|
|
123
|
+
cta_name: string;
|
|
124
|
+
section?: string | null | undefined;
|
|
125
|
+
destination_url?: string | null | undefined;
|
|
126
|
+
}, {
|
|
127
|
+
page: {
|
|
128
|
+
path: string;
|
|
129
|
+
};
|
|
130
|
+
cta_name: string;
|
|
131
|
+
section?: string | null | undefined;
|
|
132
|
+
destination_url?: string | null | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
type CtaClickMetadata = z.infer<typeof ctaClickMetadataSchema>;
|
|
135
|
+
declare const ctaClickConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
136
|
+
type CtaClickConfig = z.infer<typeof ctaClickConfigSchema>;
|
|
137
|
+
|
|
138
|
+
declare const sdkHeartbeatMetadataSchema: z.ZodObject<{
|
|
139
|
+
sdk_version: z.ZodString;
|
|
140
|
+
package_name: z.ZodNullable<z.ZodString>;
|
|
141
|
+
surface: z.ZodEnum<["next", "react", "script"]>;
|
|
142
|
+
triggers: z.ZodObject<{
|
|
143
|
+
automatic: z.ZodArray<z.ZodString, "many">;
|
|
144
|
+
manual: z.ZodArray<z.ZodString, "many">;
|
|
145
|
+
}, "strict", z.ZodTypeAny, {
|
|
146
|
+
automatic: string[];
|
|
147
|
+
manual: string[];
|
|
148
|
+
}, {
|
|
149
|
+
automatic: string[];
|
|
150
|
+
manual: string[];
|
|
151
|
+
}>;
|
|
152
|
+
trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
153
|
+
}, "strict", z.ZodTypeAny, {
|
|
154
|
+
sdk_version: string;
|
|
155
|
+
package_name: string | null;
|
|
156
|
+
surface: "next" | "react" | "script";
|
|
157
|
+
triggers: {
|
|
158
|
+
automatic: string[];
|
|
159
|
+
manual: string[];
|
|
160
|
+
};
|
|
161
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
162
|
+
}, {
|
|
163
|
+
sdk_version: string;
|
|
164
|
+
package_name: string | null;
|
|
165
|
+
surface: "next" | "react" | "script";
|
|
166
|
+
triggers: {
|
|
167
|
+
automatic: string[];
|
|
168
|
+
manual: string[];
|
|
169
|
+
};
|
|
170
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
171
|
+
}>;
|
|
172
|
+
type SdkHeartbeatMetadata = z.infer<typeof sdkHeartbeatMetadataSchema>;
|
|
173
|
+
declare const sdkHeartbeatConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
174
|
+
type SdkHeartbeatConfig = z.infer<typeof sdkHeartbeatConfigSchema>;
|
|
175
|
+
|
|
176
|
+
declare const formStartMetadataSchema: z.ZodObject<{
|
|
177
|
+
form: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
action: z.ZodNullable<z.ZodString>;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
id: string;
|
|
182
|
+
action: string | null;
|
|
183
|
+
}, {
|
|
184
|
+
id: string;
|
|
185
|
+
action: string | null;
|
|
186
|
+
}>;
|
|
187
|
+
page: z.ZodObject<{
|
|
188
|
+
path: z.ZodString;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
path: string;
|
|
191
|
+
}, {
|
|
192
|
+
path: string;
|
|
193
|
+
}>;
|
|
194
|
+
}, "strict", z.ZodTypeAny, {
|
|
195
|
+
form: {
|
|
196
|
+
id: string;
|
|
197
|
+
action: string | null;
|
|
198
|
+
};
|
|
199
|
+
page: {
|
|
200
|
+
path: string;
|
|
201
|
+
};
|
|
202
|
+
}, {
|
|
203
|
+
form: {
|
|
204
|
+
id: string;
|
|
205
|
+
action: string | null;
|
|
206
|
+
};
|
|
207
|
+
page: {
|
|
208
|
+
path: string;
|
|
209
|
+
};
|
|
210
|
+
}>;
|
|
211
|
+
type FormStartMetadata = z.infer<typeof formStartMetadataSchema>;
|
|
212
|
+
declare const formStartConfigSchema: z.ZodObject<{
|
|
213
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, "strict", z.ZodTypeAny, {
|
|
215
|
+
selector?: string | undefined;
|
|
216
|
+
}, {
|
|
217
|
+
selector?: string | undefined;
|
|
218
|
+
}>;
|
|
219
|
+
type FormStartConfig = z.infer<typeof formStartConfigSchema>;
|
|
220
|
+
|
|
221
|
+
declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
222
|
+
form: z.ZodObject<{
|
|
223
|
+
id: z.ZodString;
|
|
224
|
+
action: z.ZodNullable<z.ZodString>;
|
|
225
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
226
|
+
name: z.ZodString;
|
|
227
|
+
type: z.ZodString;
|
|
228
|
+
label: z.ZodNullable<z.ZodString>;
|
|
229
|
+
has_value: z.ZodBoolean;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
label: string | null;
|
|
232
|
+
type: string;
|
|
233
|
+
name: string;
|
|
234
|
+
has_value: boolean;
|
|
235
|
+
}, {
|
|
236
|
+
label: string | null;
|
|
237
|
+
type: string;
|
|
238
|
+
name: string;
|
|
239
|
+
has_value: boolean;
|
|
240
|
+
}>, "many">>;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
id: string;
|
|
243
|
+
action: string | null;
|
|
244
|
+
fields?: {
|
|
245
|
+
label: string | null;
|
|
246
|
+
type: string;
|
|
247
|
+
name: string;
|
|
248
|
+
has_value: boolean;
|
|
249
|
+
}[] | undefined;
|
|
250
|
+
}, {
|
|
251
|
+
id: string;
|
|
252
|
+
action: string | null;
|
|
253
|
+
fields?: {
|
|
254
|
+
label: string | null;
|
|
255
|
+
type: string;
|
|
256
|
+
name: string;
|
|
257
|
+
has_value: boolean;
|
|
258
|
+
}[] | undefined;
|
|
259
|
+
}>;
|
|
260
|
+
page: z.ZodObject<{
|
|
261
|
+
path: z.ZodString;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
path: string;
|
|
264
|
+
}, {
|
|
265
|
+
path: string;
|
|
266
|
+
}>;
|
|
267
|
+
}, "strict", z.ZodTypeAny, {
|
|
268
|
+
form: {
|
|
269
|
+
id: string;
|
|
270
|
+
action: string | null;
|
|
271
|
+
fields?: {
|
|
272
|
+
label: string | null;
|
|
273
|
+
type: string;
|
|
274
|
+
name: string;
|
|
275
|
+
has_value: boolean;
|
|
276
|
+
}[] | undefined;
|
|
277
|
+
};
|
|
278
|
+
page: {
|
|
279
|
+
path: string;
|
|
280
|
+
};
|
|
281
|
+
}, {
|
|
282
|
+
form: {
|
|
283
|
+
id: string;
|
|
284
|
+
action: string | null;
|
|
285
|
+
fields?: {
|
|
286
|
+
label: string | null;
|
|
287
|
+
type: string;
|
|
288
|
+
name: string;
|
|
289
|
+
has_value: boolean;
|
|
290
|
+
}[] | undefined;
|
|
291
|
+
};
|
|
292
|
+
page: {
|
|
293
|
+
path: string;
|
|
294
|
+
};
|
|
295
|
+
}>;
|
|
296
|
+
type FormSubmitMetadata = z.infer<typeof formSubmitMetadataSchema>;
|
|
297
|
+
declare const formSubmitConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
298
|
+
type FormSubmitConfig = z.infer<typeof formSubmitConfigSchema>;
|
|
299
|
+
|
|
300
|
+
declare const multiPageSessionMetadataSchema: z.ZodObject<{
|
|
301
|
+
page_count: z.ZodNumber;
|
|
302
|
+
page: z.ZodObject<{
|
|
303
|
+
path: z.ZodString;
|
|
304
|
+
}, "strip", z.ZodTypeAny, {
|
|
305
|
+
path: string;
|
|
306
|
+
}, {
|
|
307
|
+
path: string;
|
|
308
|
+
}>;
|
|
309
|
+
}, "strict", z.ZodTypeAny, {
|
|
310
|
+
page: {
|
|
311
|
+
path: string;
|
|
312
|
+
};
|
|
313
|
+
page_count: number;
|
|
314
|
+
}, {
|
|
315
|
+
page: {
|
|
316
|
+
path: string;
|
|
317
|
+
};
|
|
318
|
+
page_count: number;
|
|
319
|
+
}>;
|
|
320
|
+
type MultiPageSessionMetadata = z.infer<typeof multiPageSessionMetadataSchema>;
|
|
321
|
+
declare const multiPageSessionConfigSchema: z.ZodObject<{
|
|
322
|
+
pageThreshold: z.ZodNumber;
|
|
323
|
+
}, "strict", z.ZodTypeAny, {
|
|
324
|
+
pageThreshold: number;
|
|
325
|
+
}, {
|
|
326
|
+
pageThreshold: number;
|
|
327
|
+
}>;
|
|
328
|
+
type MultiPageSessionConfig = z.infer<typeof multiPageSessionConfigSchema>;
|
|
121
329
|
|
|
122
330
|
declare const pageViewMetadataSchema: z.ZodObject<{
|
|
123
331
|
page: z.ZodObject<{
|
|
@@ -176,7 +384,8 @@ type PageViewMetadata = z.infer<typeof pageViewMetadataSchema>;
|
|
|
176
384
|
declare const pageViewConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
177
385
|
type PageViewConfig = z.infer<typeof pageViewConfigSchema>;
|
|
178
386
|
|
|
179
|
-
declare const
|
|
387
|
+
declare const phoneClickMetadataSchema: z.ZodObject<{
|
|
388
|
+
phone_number: z.ZodString;
|
|
180
389
|
page: z.ZodObject<{
|
|
181
390
|
path: z.ZodString;
|
|
182
391
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -184,36 +393,26 @@ declare const contactPageVisitMetadataSchema: z.ZodObject<{
|
|
|
184
393
|
}, {
|
|
185
394
|
path: string;
|
|
186
395
|
}>;
|
|
396
|
+
section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
397
|
}, "strict", z.ZodTypeAny, {
|
|
188
398
|
page: {
|
|
189
399
|
path: string;
|
|
190
400
|
};
|
|
401
|
+
phone_number: string;
|
|
402
|
+
section?: string | null | undefined;
|
|
191
403
|
}, {
|
|
192
404
|
page: {
|
|
193
405
|
path: string;
|
|
194
406
|
};
|
|
407
|
+
phone_number: string;
|
|
408
|
+
section?: string | null | undefined;
|
|
195
409
|
}>;
|
|
196
|
-
type
|
|
197
|
-
declare const
|
|
198
|
-
|
|
199
|
-
}, "strict", z.ZodTypeAny, {
|
|
200
|
-
pathPattern: RegExp;
|
|
201
|
-
}, {
|
|
202
|
-
pathPattern: RegExp;
|
|
203
|
-
}>;
|
|
204
|
-
type ContactPageVisitConfig = z.infer<typeof contactPageVisitConfigSchema>;
|
|
410
|
+
type PhoneClickMetadata = z.infer<typeof phoneClickMetadataSchema>;
|
|
411
|
+
declare const phoneClickConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
412
|
+
type PhoneClickConfig = z.infer<typeof phoneClickConfigSchema>;
|
|
205
413
|
|
|
206
|
-
declare const
|
|
207
|
-
|
|
208
|
-
id: z.ZodString;
|
|
209
|
-
action: z.ZodNullable<z.ZodString>;
|
|
210
|
-
}, "strip", z.ZodTypeAny, {
|
|
211
|
-
id: string;
|
|
212
|
-
action: string | null;
|
|
213
|
-
}, {
|
|
214
|
-
id: string;
|
|
215
|
-
action: string | null;
|
|
216
|
-
}>;
|
|
414
|
+
declare const scrollDepthMetadataSchema: z.ZodObject<{
|
|
415
|
+
depth_percent: z.ZodNumber;
|
|
217
416
|
page: z.ZodObject<{
|
|
218
417
|
path: z.ZodString;
|
|
219
418
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -222,40 +421,30 @@ declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
|
222
421
|
path: string;
|
|
223
422
|
}>;
|
|
224
423
|
}, "strict", z.ZodTypeAny, {
|
|
225
|
-
form: {
|
|
226
|
-
id: string;
|
|
227
|
-
action: string | null;
|
|
228
|
-
};
|
|
229
424
|
page: {
|
|
230
425
|
path: string;
|
|
231
426
|
};
|
|
427
|
+
depth_percent: number;
|
|
232
428
|
}, {
|
|
233
|
-
form: {
|
|
234
|
-
id: string;
|
|
235
|
-
action: string | null;
|
|
236
|
-
};
|
|
237
429
|
page: {
|
|
238
430
|
path: string;
|
|
239
431
|
};
|
|
432
|
+
depth_percent: number;
|
|
240
433
|
}>;
|
|
241
|
-
type
|
|
242
|
-
declare const
|
|
243
|
-
|
|
434
|
+
type ScrollDepthMetadata = z.infer<typeof scrollDepthMetadataSchema>;
|
|
435
|
+
declare const scrollDepthConfigSchema: z.ZodObject<{
|
|
436
|
+
thresholds: z.ZodArray<z.ZodNumber, "many">;
|
|
437
|
+
}, "strict", z.ZodTypeAny, {
|
|
438
|
+
thresholds: number[];
|
|
439
|
+
}, {
|
|
440
|
+
thresholds: number[];
|
|
441
|
+
}>;
|
|
442
|
+
type ScrollDepthConfig = z.infer<typeof scrollDepthConfigSchema>;
|
|
244
443
|
|
|
245
|
-
declare const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
href: z.ZodString;
|
|
250
|
-
}, "strip", z.ZodTypeAny, {
|
|
251
|
-
text: string | null;
|
|
252
|
-
tag: string;
|
|
253
|
-
href: string;
|
|
254
|
-
}, {
|
|
255
|
-
text: string | null;
|
|
256
|
-
tag: string;
|
|
257
|
-
href: string;
|
|
258
|
-
}>;
|
|
444
|
+
declare const SPECIFIC_PAGE_NAMES: readonly ["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"];
|
|
445
|
+
type SpecificPageName = (typeof SPECIFIC_PAGE_NAMES)[number];
|
|
446
|
+
declare const specificPageVisitMetadataSchema: z.ZodObject<{
|
|
447
|
+
page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
259
448
|
page: z.ZodObject<{
|
|
260
449
|
path: z.ZodString;
|
|
261
450
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -267,24 +456,37 @@ declare const phoneClickMetadataSchema: z.ZodObject<{
|
|
|
267
456
|
page: {
|
|
268
457
|
path: string;
|
|
269
458
|
};
|
|
270
|
-
|
|
271
|
-
text: string | null;
|
|
272
|
-
tag: string;
|
|
273
|
-
href: string;
|
|
274
|
-
};
|
|
459
|
+
page_name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
275
460
|
}, {
|
|
276
461
|
page: {
|
|
277
462
|
path: string;
|
|
278
463
|
};
|
|
279
|
-
|
|
280
|
-
text: string | null;
|
|
281
|
-
tag: string;
|
|
282
|
-
href: string;
|
|
283
|
-
};
|
|
464
|
+
page_name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
284
465
|
}>;
|
|
285
|
-
type
|
|
286
|
-
declare const
|
|
287
|
-
|
|
466
|
+
type SpecificPageVisitMetadata = z.infer<typeof specificPageVisitMetadataSchema>;
|
|
467
|
+
declare const specificPageVisitConfigSchema: z.ZodObject<{
|
|
468
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
469
|
+
name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
470
|
+
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
471
|
+
}, "strip", z.ZodTypeAny, {
|
|
472
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
473
|
+
pathPattern: RegExp;
|
|
474
|
+
}, {
|
|
475
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
476
|
+
pathPattern: RegExp;
|
|
477
|
+
}>, "many">;
|
|
478
|
+
}, "strict", z.ZodTypeAny, {
|
|
479
|
+
pages: {
|
|
480
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
481
|
+
pathPattern: RegExp;
|
|
482
|
+
}[];
|
|
483
|
+
}, {
|
|
484
|
+
pages: {
|
|
485
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
486
|
+
pathPattern: RegExp;
|
|
487
|
+
}[];
|
|
488
|
+
}>;
|
|
489
|
+
type SpecificPageVisitConfig = z.infer<typeof specificPageVisitConfigSchema>;
|
|
288
490
|
|
|
289
491
|
declare const timeOnSiteMetadataSchema: z.ZodObject<{
|
|
290
492
|
duration_ms: z.ZodNumber;
|
|
@@ -404,9 +606,124 @@ declare const EVENT_REGISTRY: {
|
|
|
404
606
|
thresholdSeconds: number;
|
|
405
607
|
}>;
|
|
406
608
|
};
|
|
407
|
-
readonly
|
|
609
|
+
readonly specific_page_visit: {
|
|
610
|
+
readonly kind: "automatic";
|
|
611
|
+
readonly metadataSchema: z.ZodObject<{
|
|
612
|
+
page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
613
|
+
page: z.ZodObject<{
|
|
614
|
+
path: z.ZodString;
|
|
615
|
+
}, "strip", z.ZodTypeAny, {
|
|
616
|
+
path: string;
|
|
617
|
+
}, {
|
|
618
|
+
path: string;
|
|
619
|
+
}>;
|
|
620
|
+
}, "strict", z.ZodTypeAny, {
|
|
621
|
+
page: {
|
|
622
|
+
path: string;
|
|
623
|
+
};
|
|
624
|
+
page_name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
625
|
+
}, {
|
|
626
|
+
page: {
|
|
627
|
+
path: string;
|
|
628
|
+
};
|
|
629
|
+
page_name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
630
|
+
}>;
|
|
631
|
+
readonly configSchema: z.ZodObject<{
|
|
632
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
633
|
+
name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
634
|
+
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
635
|
+
}, "strip", z.ZodTypeAny, {
|
|
636
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
637
|
+
pathPattern: RegExp;
|
|
638
|
+
}, {
|
|
639
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
640
|
+
pathPattern: RegExp;
|
|
641
|
+
}>, "many">;
|
|
642
|
+
}, "strict", z.ZodTypeAny, {
|
|
643
|
+
pages: {
|
|
644
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
645
|
+
pathPattern: RegExp;
|
|
646
|
+
}[];
|
|
647
|
+
}, {
|
|
648
|
+
pages: {
|
|
649
|
+
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
650
|
+
pathPattern: RegExp;
|
|
651
|
+
}[];
|
|
652
|
+
}>;
|
|
653
|
+
};
|
|
654
|
+
readonly scroll_depth: {
|
|
655
|
+
readonly kind: "automatic";
|
|
656
|
+
readonly metadataSchema: z.ZodObject<{
|
|
657
|
+
depth_percent: z.ZodNumber;
|
|
658
|
+
page: z.ZodObject<{
|
|
659
|
+
path: z.ZodString;
|
|
660
|
+
}, "strip", z.ZodTypeAny, {
|
|
661
|
+
path: string;
|
|
662
|
+
}, {
|
|
663
|
+
path: string;
|
|
664
|
+
}>;
|
|
665
|
+
}, "strict", z.ZodTypeAny, {
|
|
666
|
+
page: {
|
|
667
|
+
path: string;
|
|
668
|
+
};
|
|
669
|
+
depth_percent: number;
|
|
670
|
+
}, {
|
|
671
|
+
page: {
|
|
672
|
+
path: string;
|
|
673
|
+
};
|
|
674
|
+
depth_percent: number;
|
|
675
|
+
}>;
|
|
676
|
+
readonly configSchema: z.ZodObject<{
|
|
677
|
+
thresholds: z.ZodArray<z.ZodNumber, "many">;
|
|
678
|
+
}, "strict", z.ZodTypeAny, {
|
|
679
|
+
thresholds: number[];
|
|
680
|
+
}, {
|
|
681
|
+
thresholds: number[];
|
|
682
|
+
}>;
|
|
683
|
+
};
|
|
684
|
+
readonly multi_page_session: {
|
|
685
|
+
readonly kind: "automatic";
|
|
686
|
+
readonly metadataSchema: z.ZodObject<{
|
|
687
|
+
page_count: z.ZodNumber;
|
|
688
|
+
page: z.ZodObject<{
|
|
689
|
+
path: z.ZodString;
|
|
690
|
+
}, "strip", z.ZodTypeAny, {
|
|
691
|
+
path: string;
|
|
692
|
+
}, {
|
|
693
|
+
path: string;
|
|
694
|
+
}>;
|
|
695
|
+
}, "strict", z.ZodTypeAny, {
|
|
696
|
+
page: {
|
|
697
|
+
path: string;
|
|
698
|
+
};
|
|
699
|
+
page_count: number;
|
|
700
|
+
}, {
|
|
701
|
+
page: {
|
|
702
|
+
path: string;
|
|
703
|
+
};
|
|
704
|
+
page_count: number;
|
|
705
|
+
}>;
|
|
706
|
+
readonly configSchema: z.ZodObject<{
|
|
707
|
+
pageThreshold: z.ZodNumber;
|
|
708
|
+
}, "strict", z.ZodTypeAny, {
|
|
709
|
+
pageThreshold: number;
|
|
710
|
+
}, {
|
|
711
|
+
pageThreshold: number;
|
|
712
|
+
}>;
|
|
713
|
+
};
|
|
714
|
+
readonly form_start: {
|
|
408
715
|
readonly kind: "automatic";
|
|
409
716
|
readonly metadataSchema: z.ZodObject<{
|
|
717
|
+
form: z.ZodObject<{
|
|
718
|
+
id: z.ZodString;
|
|
719
|
+
action: z.ZodNullable<z.ZodString>;
|
|
720
|
+
}, "strip", z.ZodTypeAny, {
|
|
721
|
+
id: string;
|
|
722
|
+
action: string | null;
|
|
723
|
+
}, {
|
|
724
|
+
id: string;
|
|
725
|
+
action: string | null;
|
|
726
|
+
}>;
|
|
410
727
|
page: z.ZodObject<{
|
|
411
728
|
path: z.ZodString;
|
|
412
729
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -415,34 +732,108 @@ declare const EVENT_REGISTRY: {
|
|
|
415
732
|
path: string;
|
|
416
733
|
}>;
|
|
417
734
|
}, "strict", z.ZodTypeAny, {
|
|
735
|
+
form: {
|
|
736
|
+
id: string;
|
|
737
|
+
action: string | null;
|
|
738
|
+
};
|
|
418
739
|
page: {
|
|
419
740
|
path: string;
|
|
420
741
|
};
|
|
421
742
|
}, {
|
|
743
|
+
form: {
|
|
744
|
+
id: string;
|
|
745
|
+
action: string | null;
|
|
746
|
+
};
|
|
422
747
|
page: {
|
|
423
748
|
path: string;
|
|
424
749
|
};
|
|
425
750
|
}>;
|
|
426
751
|
readonly configSchema: z.ZodObject<{
|
|
427
|
-
|
|
752
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
428
753
|
}, "strict", z.ZodTypeAny, {
|
|
429
|
-
|
|
754
|
+
selector?: string | undefined;
|
|
430
755
|
}, {
|
|
431
|
-
|
|
756
|
+
selector?: string | undefined;
|
|
432
757
|
}>;
|
|
433
758
|
};
|
|
759
|
+
readonly sdk_heartbeat: {
|
|
760
|
+
readonly kind: "automatic";
|
|
761
|
+
readonly metadataSchema: z.ZodObject<{
|
|
762
|
+
sdk_version: z.ZodString;
|
|
763
|
+
package_name: z.ZodNullable<z.ZodString>;
|
|
764
|
+
surface: z.ZodEnum<["next", "react", "script"]>;
|
|
765
|
+
triggers: z.ZodObject<{
|
|
766
|
+
automatic: z.ZodArray<z.ZodString, "many">;
|
|
767
|
+
manual: z.ZodArray<z.ZodString, "many">;
|
|
768
|
+
}, "strict", z.ZodTypeAny, {
|
|
769
|
+
automatic: string[];
|
|
770
|
+
manual: string[];
|
|
771
|
+
}, {
|
|
772
|
+
automatic: string[];
|
|
773
|
+
manual: string[];
|
|
774
|
+
}>;
|
|
775
|
+
trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
776
|
+
}, "strict", z.ZodTypeAny, {
|
|
777
|
+
sdk_version: string;
|
|
778
|
+
package_name: string | null;
|
|
779
|
+
surface: "next" | "react" | "script";
|
|
780
|
+
triggers: {
|
|
781
|
+
automatic: string[];
|
|
782
|
+
manual: string[];
|
|
783
|
+
};
|
|
784
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
785
|
+
}, {
|
|
786
|
+
sdk_version: string;
|
|
787
|
+
package_name: string | null;
|
|
788
|
+
surface: "next" | "react" | "script";
|
|
789
|
+
triggers: {
|
|
790
|
+
automatic: string[];
|
|
791
|
+
manual: string[];
|
|
792
|
+
};
|
|
793
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
794
|
+
}>;
|
|
795
|
+
readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
796
|
+
};
|
|
434
797
|
readonly form_submit: {
|
|
435
798
|
readonly kind: "manual";
|
|
436
799
|
readonly metadataSchema: z.ZodObject<{
|
|
437
800
|
form: z.ZodObject<{
|
|
438
801
|
id: z.ZodString;
|
|
439
802
|
action: z.ZodNullable<z.ZodString>;
|
|
803
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
804
|
+
name: z.ZodString;
|
|
805
|
+
type: z.ZodString;
|
|
806
|
+
label: z.ZodNullable<z.ZodString>;
|
|
807
|
+
has_value: z.ZodBoolean;
|
|
808
|
+
}, "strip", z.ZodTypeAny, {
|
|
809
|
+
label: string | null;
|
|
810
|
+
type: string;
|
|
811
|
+
name: string;
|
|
812
|
+
has_value: boolean;
|
|
813
|
+
}, {
|
|
814
|
+
label: string | null;
|
|
815
|
+
type: string;
|
|
816
|
+
name: string;
|
|
817
|
+
has_value: boolean;
|
|
818
|
+
}>, "many">>;
|
|
440
819
|
}, "strip", z.ZodTypeAny, {
|
|
441
820
|
id: string;
|
|
442
821
|
action: string | null;
|
|
822
|
+
fields?: {
|
|
823
|
+
label: string | null;
|
|
824
|
+
type: string;
|
|
825
|
+
name: string;
|
|
826
|
+
has_value: boolean;
|
|
827
|
+
}[] | undefined;
|
|
443
828
|
}, {
|
|
444
829
|
id: string;
|
|
445
830
|
action: string | null;
|
|
831
|
+
fields?: {
|
|
832
|
+
label: string | null;
|
|
833
|
+
type: string;
|
|
834
|
+
name: string;
|
|
835
|
+
has_value: boolean;
|
|
836
|
+
}[] | undefined;
|
|
446
837
|
}>;
|
|
447
838
|
page: z.ZodObject<{
|
|
448
839
|
path: z.ZodString;
|
|
@@ -455,6 +846,12 @@ declare const EVENT_REGISTRY: {
|
|
|
455
846
|
form: {
|
|
456
847
|
id: string;
|
|
457
848
|
action: string | null;
|
|
849
|
+
fields?: {
|
|
850
|
+
label: string | null;
|
|
851
|
+
type: string;
|
|
852
|
+
name: string;
|
|
853
|
+
has_value: boolean;
|
|
854
|
+
}[] | undefined;
|
|
458
855
|
};
|
|
459
856
|
page: {
|
|
460
857
|
path: string;
|
|
@@ -463,6 +860,12 @@ declare const EVENT_REGISTRY: {
|
|
|
463
860
|
form: {
|
|
464
861
|
id: string;
|
|
465
862
|
action: string | null;
|
|
863
|
+
fields?: {
|
|
864
|
+
label: string | null;
|
|
865
|
+
type: string;
|
|
866
|
+
name: string;
|
|
867
|
+
has_value: boolean;
|
|
868
|
+
}[] | undefined;
|
|
466
869
|
};
|
|
467
870
|
page: {
|
|
468
871
|
path: string;
|
|
@@ -473,19 +876,34 @@ declare const EVENT_REGISTRY: {
|
|
|
473
876
|
readonly phone_click: {
|
|
474
877
|
readonly kind: "manual";
|
|
475
878
|
readonly metadataSchema: z.ZodObject<{
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
href: z.ZodString;
|
|
879
|
+
phone_number: z.ZodString;
|
|
880
|
+
page: z.ZodObject<{
|
|
881
|
+
path: z.ZodString;
|
|
480
882
|
}, "strip", z.ZodTypeAny, {
|
|
481
|
-
|
|
482
|
-
tag: string;
|
|
483
|
-
href: string;
|
|
883
|
+
path: string;
|
|
484
884
|
}, {
|
|
485
|
-
|
|
486
|
-
tag: string;
|
|
487
|
-
href: string;
|
|
885
|
+
path: string;
|
|
488
886
|
}>;
|
|
887
|
+
section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
888
|
+
}, "strict", z.ZodTypeAny, {
|
|
889
|
+
page: {
|
|
890
|
+
path: string;
|
|
891
|
+
};
|
|
892
|
+
phone_number: string;
|
|
893
|
+
section?: string | null | undefined;
|
|
894
|
+
}, {
|
|
895
|
+
page: {
|
|
896
|
+
path: string;
|
|
897
|
+
};
|
|
898
|
+
phone_number: string;
|
|
899
|
+
section?: string | null | undefined;
|
|
900
|
+
}>;
|
|
901
|
+
readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
902
|
+
};
|
|
903
|
+
readonly cta_click: {
|
|
904
|
+
readonly kind: "manual";
|
|
905
|
+
readonly metadataSchema: z.ZodObject<{
|
|
906
|
+
cta_name: z.ZodString;
|
|
489
907
|
page: z.ZodObject<{
|
|
490
908
|
path: z.ZodString;
|
|
491
909
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -493,24 +911,22 @@ declare const EVENT_REGISTRY: {
|
|
|
493
911
|
}, {
|
|
494
912
|
path: string;
|
|
495
913
|
}>;
|
|
914
|
+
section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
915
|
+
destination_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
496
916
|
}, "strict", z.ZodTypeAny, {
|
|
497
917
|
page: {
|
|
498
918
|
path: string;
|
|
499
919
|
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
href: string;
|
|
504
|
-
};
|
|
920
|
+
cta_name: string;
|
|
921
|
+
section?: string | null | undefined;
|
|
922
|
+
destination_url?: string | null | undefined;
|
|
505
923
|
}, {
|
|
506
924
|
page: {
|
|
507
925
|
path: string;
|
|
508
926
|
};
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
href: string;
|
|
513
|
-
};
|
|
927
|
+
cta_name: string;
|
|
928
|
+
section?: string | null | undefined;
|
|
929
|
+
destination_url?: string | null | undefined;
|
|
514
930
|
}>;
|
|
515
931
|
readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
516
932
|
};
|
|
@@ -525,16 +941,26 @@ type ManualEventName = {
|
|
|
525
941
|
type MetadataByName = {
|
|
526
942
|
page_view: PageViewMetadata;
|
|
527
943
|
time_on_site: TimeOnSiteMetadata;
|
|
528
|
-
|
|
944
|
+
specific_page_visit: SpecificPageVisitMetadata;
|
|
945
|
+
scroll_depth: ScrollDepthMetadata;
|
|
946
|
+
multi_page_session: MultiPageSessionMetadata;
|
|
947
|
+
form_start: FormStartMetadata;
|
|
948
|
+
sdk_heartbeat: SdkHeartbeatMetadata;
|
|
529
949
|
form_submit: FormSubmitMetadata;
|
|
530
950
|
phone_click: PhoneClickMetadata;
|
|
951
|
+
cta_click: CtaClickMetadata;
|
|
531
952
|
};
|
|
532
953
|
type ConfigByName = {
|
|
533
954
|
page_view: PageViewConfig;
|
|
534
955
|
time_on_site: TimeOnSiteConfig;
|
|
535
|
-
|
|
956
|
+
specific_page_visit: SpecificPageVisitConfig;
|
|
957
|
+
scroll_depth: ScrollDepthConfig;
|
|
958
|
+
multi_page_session: MultiPageSessionConfig;
|
|
959
|
+
form_start: FormStartConfig;
|
|
960
|
+
sdk_heartbeat: SdkHeartbeatConfig;
|
|
536
961
|
form_submit: FormSubmitConfig;
|
|
537
962
|
phone_click: PhoneClickConfig;
|
|
963
|
+
cta_click: CtaClickConfig;
|
|
538
964
|
};
|
|
539
965
|
type EventMetadata<K extends EventName> = MetadataByName[K];
|
|
540
966
|
type EventConfig<K extends EventName> = ConfigByName[K];
|
|
@@ -543,16 +969,34 @@ type TriggerRegistryConfig = {
|
|
|
543
969
|
page_view: EventConfig<'page_view'>;
|
|
544
970
|
} & Partial<{
|
|
545
971
|
time_on_site: EventConfig<'time_on_site'>;
|
|
546
|
-
|
|
972
|
+
specific_page_visit: EventConfig<'specific_page_visit'>;
|
|
973
|
+
scroll_depth: EventConfig<'scroll_depth'>;
|
|
974
|
+
multi_page_session: EventConfig<'multi_page_session'>;
|
|
975
|
+
form_start: EventConfig<'form_start'>;
|
|
547
976
|
}>;
|
|
548
977
|
manual?: Partial<{
|
|
549
978
|
form_submit: EventConfig<'form_submit'>;
|
|
550
979
|
phone_click: EventConfig<'phone_click'>;
|
|
980
|
+
cta_click: EventConfig<'cta_click'>;
|
|
551
981
|
}>;
|
|
552
982
|
};
|
|
553
983
|
type RegisteredManualEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof NonNullable<TRegistry['manual']>, ManualEventName>;
|
|
554
984
|
type RegisteredAutomaticEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof TRegistry['automatic'], AutomaticEventName>;
|
|
555
985
|
|
|
986
|
+
interface TrackEventInput {
|
|
987
|
+
eventType: string;
|
|
988
|
+
pageUrl?: string | null;
|
|
989
|
+
metadata?: Record<string, unknown> | null;
|
|
990
|
+
occurredAt?: Date | string | null;
|
|
991
|
+
}
|
|
992
|
+
interface TrackingClient {
|
|
993
|
+
trackEvent: (input: TrackEventInput) => void;
|
|
994
|
+
flush: () => Promise<void>;
|
|
995
|
+
getSessionId: () => string;
|
|
996
|
+
getVisitorId: () => string;
|
|
997
|
+
destroy: () => void;
|
|
998
|
+
}
|
|
999
|
+
|
|
556
1000
|
interface TypedTrackEventOptions {
|
|
557
1001
|
/** Override the page URL captured automatically. Rarely needed. */
|
|
558
1002
|
pageUrl?: string | null;
|
|
@@ -604,4 +1048,4 @@ interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
|
|
|
604
1048
|
}
|
|
605
1049
|
declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
|
|
606
1050
|
|
|
607
|
-
export { type AutomaticEventName, ConsentBanner, type ConsentState, type
|
|
1051
|
+
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 };
|