@aranova/tracking-react 0.19.2 → 0.20.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/README.md +4 -1
- package/dist/index.d.mts +29 -24
- package/dist/index.d.ts +29 -24
- package/dist/index.js +8 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -13
- package/dist/index.mjs.map +1 -1
- package/dist/phone.js +6 -11
- package/dist/phone.js.map +1 -1
- package/dist/phone.mjs +6 -11
- package/dist/phone.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,10 @@ export const { TrackingProvider, useTracking } = createTracking({
|
|
|
26
26
|
page_view: {},
|
|
27
27
|
time_on_site: { thresholdSeconds: 60 },
|
|
28
28
|
specific_page_visit: {
|
|
29
|
-
pages: [
|
|
29
|
+
pages: [
|
|
30
|
+
{ name: "contact_page", pathPattern: /^\/(contact|book|get-started)/ },
|
|
31
|
+
{ name: "google_ads_service_page", pathPattern: /^\/services\/google-ads\/?$/ },
|
|
32
|
+
],
|
|
30
33
|
},
|
|
31
34
|
},
|
|
32
35
|
manual: {
|
package/dist/index.d.mts
CHANGED
|
@@ -550,12 +550,16 @@ declare const scrollDepthConfigSchema: z.ZodObject<{
|
|
|
550
550
|
}>;
|
|
551
551
|
type ScrollDepthConfig = z.infer<typeof scrollDepthConfigSchema>;
|
|
552
552
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
*/
|
|
553
|
+
declare const PAGE_IDENTITY_MAX_LENGTH = 64;
|
|
554
|
+
declare const PAGE_IDENTITY_PATTERN: RegExp;
|
|
555
|
+
/** Common page identities offered as presets by operator tooling. */
|
|
556
556
|
declare const SPECIFIC_PAGE_NAMES: readonly ["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"];
|
|
557
|
-
|
|
558
|
-
|
|
557
|
+
declare const pageIdentitySchema: z.ZodString;
|
|
558
|
+
type PageIdentity = z.infer<typeof pageIdentitySchema>;
|
|
559
|
+
/** @deprecated Use PageIdentity. Kept as a compatibility alias for existing consumers. */
|
|
560
|
+
type SpecificPageName = PageIdentity;
|
|
561
|
+
/** @deprecated Use pageIdentitySchema. Kept for source compatibility. */
|
|
562
|
+
declare const specificPageNameSchema: z.ZodString;
|
|
559
563
|
/**
|
|
560
564
|
* Metadata for the automatic `specific_page_visit` event.
|
|
561
565
|
*
|
|
@@ -563,7 +567,7 @@ declare const specificPageNameSchema: z.ZodEnum<["contact_page", "about_page", "
|
|
|
563
567
|
* named page patterns.
|
|
564
568
|
*/
|
|
565
569
|
declare const specificPageVisitMetadataSchema: z.ZodObject<{
|
|
566
|
-
page_name: z.
|
|
570
|
+
page_name: z.ZodString;
|
|
567
571
|
page: z.ZodObject<{
|
|
568
572
|
path: z.ZodString;
|
|
569
573
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -575,39 +579,40 @@ declare const specificPageVisitMetadataSchema: z.ZodObject<{
|
|
|
575
579
|
page: {
|
|
576
580
|
path: string;
|
|
577
581
|
};
|
|
578
|
-
page_name:
|
|
582
|
+
page_name: string;
|
|
579
583
|
}, {
|
|
580
584
|
page: {
|
|
581
585
|
path: string;
|
|
582
586
|
};
|
|
583
|
-
page_name:
|
|
587
|
+
page_name: string;
|
|
584
588
|
}>;
|
|
585
589
|
type SpecificPageVisitMetadata = z.infer<typeof specificPageVisitMetadataSchema>;
|
|
586
590
|
/**
|
|
587
591
|
* Registration config for automatic `specific_page_visit`.
|
|
588
592
|
*
|
|
589
|
-
* Each page entry pairs a
|
|
590
|
-
* pathname.
|
|
593
|
+
* Each page entry pairs a stable, validated identity with a `RegExp` that
|
|
594
|
+
* matches the pathname. The identity can use a preset above or a client-specific
|
|
595
|
+
* lowercase snake-case slug.
|
|
591
596
|
*/
|
|
592
597
|
declare const specificPageVisitConfigSchema: z.ZodObject<{
|
|
593
598
|
pages: z.ZodArray<z.ZodObject<{
|
|
594
|
-
name: z.
|
|
599
|
+
name: z.ZodString;
|
|
595
600
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
596
601
|
}, "strict", z.ZodTypeAny, {
|
|
597
|
-
name:
|
|
602
|
+
name: string;
|
|
598
603
|
pathPattern: RegExp;
|
|
599
604
|
}, {
|
|
600
|
-
name:
|
|
605
|
+
name: string;
|
|
601
606
|
pathPattern: RegExp;
|
|
602
607
|
}>, "many">;
|
|
603
608
|
}, "strict", z.ZodTypeAny, {
|
|
604
609
|
pages: {
|
|
605
|
-
name:
|
|
610
|
+
name: string;
|
|
606
611
|
pathPattern: RegExp;
|
|
607
612
|
}[];
|
|
608
613
|
}, {
|
|
609
614
|
pages: {
|
|
610
|
-
name:
|
|
615
|
+
name: string;
|
|
611
616
|
pathPattern: RegExp;
|
|
612
617
|
}[];
|
|
613
618
|
}>;
|
|
@@ -847,7 +852,7 @@ declare const EVENT_REGISTRY: {
|
|
|
847
852
|
readonly clientVisibility: "detailed";
|
|
848
853
|
};
|
|
849
854
|
readonly metadataSchema: z.ZodObject<{
|
|
850
|
-
page_name: z.
|
|
855
|
+
page_name: z.ZodString;
|
|
851
856
|
page: z.ZodObject<{
|
|
852
857
|
path: z.ZodString;
|
|
853
858
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -859,32 +864,32 @@ declare const EVENT_REGISTRY: {
|
|
|
859
864
|
page: {
|
|
860
865
|
path: string;
|
|
861
866
|
};
|
|
862
|
-
page_name:
|
|
867
|
+
page_name: string;
|
|
863
868
|
}, {
|
|
864
869
|
page: {
|
|
865
870
|
path: string;
|
|
866
871
|
};
|
|
867
|
-
page_name:
|
|
872
|
+
page_name: string;
|
|
868
873
|
}>;
|
|
869
874
|
readonly configSchema: z.ZodObject<{
|
|
870
875
|
pages: z.ZodArray<z.ZodObject<{
|
|
871
|
-
name: z.
|
|
876
|
+
name: z.ZodString;
|
|
872
877
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
873
878
|
}, "strict", z.ZodTypeAny, {
|
|
874
|
-
name:
|
|
879
|
+
name: string;
|
|
875
880
|
pathPattern: RegExp;
|
|
876
881
|
}, {
|
|
877
|
-
name:
|
|
882
|
+
name: string;
|
|
878
883
|
pathPattern: RegExp;
|
|
879
884
|
}>, "many">;
|
|
880
885
|
}, "strict", z.ZodTypeAny, {
|
|
881
886
|
pages: {
|
|
882
|
-
name:
|
|
887
|
+
name: string;
|
|
883
888
|
pathPattern: RegExp;
|
|
884
889
|
}[];
|
|
885
890
|
}, {
|
|
886
891
|
pages: {
|
|
887
|
-
name:
|
|
892
|
+
name: string;
|
|
888
893
|
pathPattern: RegExp;
|
|
889
894
|
}[];
|
|
890
895
|
}>;
|
|
@@ -1804,4 +1809,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1804
1809
|
*/
|
|
1805
1810
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1806
1811
|
|
|
1807
|
-
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_LEAD_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentChoiceState, ConsentSource, ConsentState, ConversionConfig, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, EVENT_REGISTRY, EVENT_SEMANTICS, type EventCategory, type EventClientVisibility, type EventConfig, type EventKind, type EventMetadata, type EventName, type EventOutcomeRole, type EventSemantics, type FormStartConfig, type FormStartMetadata, FormSubmitConfig, FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, GtagEnvironmentMap, type ManualEventName, MetaPixelEnvironmentMap, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageExitConfig, type PageExitMetadata, 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, TrackingConfigReference, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getEventDefinition, getEventSemantics, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageExitConfigSchema, pageExitMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
|
1812
|
+
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_LEAD_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentChoiceState, ConsentSource, ConsentState, ConversionConfig, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, EVENT_REGISTRY, EVENT_SEMANTICS, type EventCategory, type EventClientVisibility, type EventConfig, type EventKind, type EventMetadata, type EventName, type EventOutcomeRole, type EventSemantics, type FormStartConfig, type FormStartMetadata, FormSubmitConfig, FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, GtagEnvironmentMap, type ManualEventName, MetaPixelEnvironmentMap, type MultiPageSessionConfig, type MultiPageSessionMetadata, PAGE_IDENTITY_MAX_LENGTH, PAGE_IDENTITY_PATTERN, type PageExitConfig, type PageExitMetadata, type PageIdentity, 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, TrackingConfigReference, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getEventDefinition, getEventSemantics, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageExitConfigSchema, pageExitMetadataSchema, pageIdentitySchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -550,12 +550,16 @@ declare const scrollDepthConfigSchema: z.ZodObject<{
|
|
|
550
550
|
}>;
|
|
551
551
|
type ScrollDepthConfig = z.infer<typeof scrollDepthConfigSchema>;
|
|
552
552
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
*/
|
|
553
|
+
declare const PAGE_IDENTITY_MAX_LENGTH = 64;
|
|
554
|
+
declare const PAGE_IDENTITY_PATTERN: RegExp;
|
|
555
|
+
/** Common page identities offered as presets by operator tooling. */
|
|
556
556
|
declare const SPECIFIC_PAGE_NAMES: readonly ["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"];
|
|
557
|
-
|
|
558
|
-
|
|
557
|
+
declare const pageIdentitySchema: z.ZodString;
|
|
558
|
+
type PageIdentity = z.infer<typeof pageIdentitySchema>;
|
|
559
|
+
/** @deprecated Use PageIdentity. Kept as a compatibility alias for existing consumers. */
|
|
560
|
+
type SpecificPageName = PageIdentity;
|
|
561
|
+
/** @deprecated Use pageIdentitySchema. Kept for source compatibility. */
|
|
562
|
+
declare const specificPageNameSchema: z.ZodString;
|
|
559
563
|
/**
|
|
560
564
|
* Metadata for the automatic `specific_page_visit` event.
|
|
561
565
|
*
|
|
@@ -563,7 +567,7 @@ declare const specificPageNameSchema: z.ZodEnum<["contact_page", "about_page", "
|
|
|
563
567
|
* named page patterns.
|
|
564
568
|
*/
|
|
565
569
|
declare const specificPageVisitMetadataSchema: z.ZodObject<{
|
|
566
|
-
page_name: z.
|
|
570
|
+
page_name: z.ZodString;
|
|
567
571
|
page: z.ZodObject<{
|
|
568
572
|
path: z.ZodString;
|
|
569
573
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -575,39 +579,40 @@ declare const specificPageVisitMetadataSchema: z.ZodObject<{
|
|
|
575
579
|
page: {
|
|
576
580
|
path: string;
|
|
577
581
|
};
|
|
578
|
-
page_name:
|
|
582
|
+
page_name: string;
|
|
579
583
|
}, {
|
|
580
584
|
page: {
|
|
581
585
|
path: string;
|
|
582
586
|
};
|
|
583
|
-
page_name:
|
|
587
|
+
page_name: string;
|
|
584
588
|
}>;
|
|
585
589
|
type SpecificPageVisitMetadata = z.infer<typeof specificPageVisitMetadataSchema>;
|
|
586
590
|
/**
|
|
587
591
|
* Registration config for automatic `specific_page_visit`.
|
|
588
592
|
*
|
|
589
|
-
* Each page entry pairs a
|
|
590
|
-
* pathname.
|
|
593
|
+
* Each page entry pairs a stable, validated identity with a `RegExp` that
|
|
594
|
+
* matches the pathname. The identity can use a preset above or a client-specific
|
|
595
|
+
* lowercase snake-case slug.
|
|
591
596
|
*/
|
|
592
597
|
declare const specificPageVisitConfigSchema: z.ZodObject<{
|
|
593
598
|
pages: z.ZodArray<z.ZodObject<{
|
|
594
|
-
name: z.
|
|
599
|
+
name: z.ZodString;
|
|
595
600
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
596
601
|
}, "strict", z.ZodTypeAny, {
|
|
597
|
-
name:
|
|
602
|
+
name: string;
|
|
598
603
|
pathPattern: RegExp;
|
|
599
604
|
}, {
|
|
600
|
-
name:
|
|
605
|
+
name: string;
|
|
601
606
|
pathPattern: RegExp;
|
|
602
607
|
}>, "many">;
|
|
603
608
|
}, "strict", z.ZodTypeAny, {
|
|
604
609
|
pages: {
|
|
605
|
-
name:
|
|
610
|
+
name: string;
|
|
606
611
|
pathPattern: RegExp;
|
|
607
612
|
}[];
|
|
608
613
|
}, {
|
|
609
614
|
pages: {
|
|
610
|
-
name:
|
|
615
|
+
name: string;
|
|
611
616
|
pathPattern: RegExp;
|
|
612
617
|
}[];
|
|
613
618
|
}>;
|
|
@@ -847,7 +852,7 @@ declare const EVENT_REGISTRY: {
|
|
|
847
852
|
readonly clientVisibility: "detailed";
|
|
848
853
|
};
|
|
849
854
|
readonly metadataSchema: z.ZodObject<{
|
|
850
|
-
page_name: z.
|
|
855
|
+
page_name: z.ZodString;
|
|
851
856
|
page: z.ZodObject<{
|
|
852
857
|
path: z.ZodString;
|
|
853
858
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -859,32 +864,32 @@ declare const EVENT_REGISTRY: {
|
|
|
859
864
|
page: {
|
|
860
865
|
path: string;
|
|
861
866
|
};
|
|
862
|
-
page_name:
|
|
867
|
+
page_name: string;
|
|
863
868
|
}, {
|
|
864
869
|
page: {
|
|
865
870
|
path: string;
|
|
866
871
|
};
|
|
867
|
-
page_name:
|
|
872
|
+
page_name: string;
|
|
868
873
|
}>;
|
|
869
874
|
readonly configSchema: z.ZodObject<{
|
|
870
875
|
pages: z.ZodArray<z.ZodObject<{
|
|
871
|
-
name: z.
|
|
876
|
+
name: z.ZodString;
|
|
872
877
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
873
878
|
}, "strict", z.ZodTypeAny, {
|
|
874
|
-
name:
|
|
879
|
+
name: string;
|
|
875
880
|
pathPattern: RegExp;
|
|
876
881
|
}, {
|
|
877
|
-
name:
|
|
882
|
+
name: string;
|
|
878
883
|
pathPattern: RegExp;
|
|
879
884
|
}>, "many">;
|
|
880
885
|
}, "strict", z.ZodTypeAny, {
|
|
881
886
|
pages: {
|
|
882
|
-
name:
|
|
887
|
+
name: string;
|
|
883
888
|
pathPattern: RegExp;
|
|
884
889
|
}[];
|
|
885
890
|
}, {
|
|
886
891
|
pages: {
|
|
887
|
-
name:
|
|
892
|
+
name: string;
|
|
888
893
|
pathPattern: RegExp;
|
|
889
894
|
}[];
|
|
890
895
|
}>;
|
|
@@ -1804,4 +1809,4 @@ interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
1804
1809
|
*/
|
|
1805
1810
|
declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1806
1811
|
|
|
1807
|
-
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_LEAD_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentChoiceState, ConsentSource, ConsentState, ConversionConfig, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, EVENT_REGISTRY, EVENT_SEMANTICS, type EventCategory, type EventClientVisibility, type EventConfig, type EventKind, type EventMetadata, type EventName, type EventOutcomeRole, type EventSemantics, type FormStartConfig, type FormStartMetadata, FormSubmitConfig, FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, GtagEnvironmentMap, type ManualEventName, MetaPixelEnvironmentMap, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageExitConfig, type PageExitMetadata, 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, TrackingConfigReference, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getEventDefinition, getEventSemantics, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageExitConfigSchema, pageExitMetadataSchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
|
1812
|
+
export { ALL_AUTOMATIC_EVENT_NAMES, ALL_LEAD_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, ConsentChoiceState, ConsentSource, ConsentState, ConversionConfig, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, EVENT_REGISTRY, EVENT_SEMANTICS, type EventCategory, type EventClientVisibility, type EventConfig, type EventKind, type EventMetadata, type EventName, type EventOutcomeRole, type EventSemantics, type FormStartConfig, type FormStartMetadata, FormSubmitConfig, FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, GtagEnvironmentMap, type ManualEventName, MetaPixelEnvironmentMap, type MultiPageSessionConfig, type MultiPageSessionMetadata, PAGE_IDENTITY_MAX_LENGTH, PAGE_IDENTITY_PATTERN, type PageExitConfig, type PageExitMetadata, type PageIdentity, 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, TrackingConfigReference, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getEventDefinition, getEventSemantics, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageExitConfigSchema, pageExitMetadataSchema, pageIdentitySchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams };
|
package/dist/index.js
CHANGED
|
@@ -2135,17 +2135,12 @@ var scrollDepthConfigSchema = import_zod9.z.object({
|
|
|
2135
2135
|
|
|
2136
2136
|
// ../tracking-core/src/events/specific-page-visit.ts
|
|
2137
2137
|
var import_zod10 = require("zod");
|
|
2138
|
-
var
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
"
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
"pricing_page",
|
|
2145
|
-
"faq_page",
|
|
2146
|
-
"testimonials_page"
|
|
2147
|
-
];
|
|
2148
|
-
var specificPageNameSchema = import_zod10.z.enum(SPECIFIC_PAGE_NAMES);
|
|
2138
|
+
var PAGE_IDENTITY_MAX_LENGTH = 64;
|
|
2139
|
+
var PAGE_IDENTITY_PATTERN = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/;
|
|
2140
|
+
var pageIdentitySchema = import_zod10.z.string().max(PAGE_IDENTITY_MAX_LENGTH).regex(PAGE_IDENTITY_PATTERN, {
|
|
2141
|
+
message: "page identity must be lowercase snake_case, start with a letter, and contain at most 64 characters"
|
|
2142
|
+
});
|
|
2143
|
+
var specificPageNameSchema = pageIdentitySchema;
|
|
2149
2144
|
var specificPageVisitMetadataSchema = import_zod10.z.object({
|
|
2150
2145
|
page_name: specificPageNameSchema,
|
|
2151
2146
|
page: import_zod10.z.object({
|
|
@@ -2857,7 +2852,7 @@ function describeElement(el) {
|
|
|
2857
2852
|
function resolveCtaName(el) {
|
|
2858
2853
|
const explicit = el.getAttribute("data-aranova-cta");
|
|
2859
2854
|
if (explicit && explicit.trim().length > 0) return explicit.trim();
|
|
2860
|
-
const text = (el.textContent ?? "").trim().
|
|
2855
|
+
const text = (el.textContent ?? "").trim().replaceAll(/\s+/g, " ");
|
|
2861
2856
|
if (text.length > 0) return text.slice(0, CTA_NAME_MAX_LENGTH);
|
|
2862
2857
|
return describeElement(el);
|
|
2863
2858
|
}
|
|
@@ -3637,7 +3632,7 @@ function GoogleAdsTracking(props) {
|
|
|
3637
3632
|
var import_react6 = require("react");
|
|
3638
3633
|
|
|
3639
3634
|
// package.json
|
|
3640
|
-
var version = "0.
|
|
3635
|
+
var version = "0.20.1";
|
|
3641
3636
|
|
|
3642
3637
|
// ../tracking-core/src/phone-react.tsx
|
|
3643
3638
|
var import_react5 = require("react");
|