react-marketing-tools 0.2.9 → 0.3.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/buildConfig/index.d.ts +8 -0
- package/dist/index.d.ts +26 -144
- package/dist/react-marketing-tools.es.js +2534 -2532
- package/dist/react-marketing-tools.umd.js +8 -8
- package/dist/types.d.ts +104 -0
- package/package.json +1 -1
- package/dist/lib/buildConfig/index.d.ts +0 -10
- package/dist/lib/buildConfig/types.d.ts +0 -28
- package/dist/lib/index.d.ts +0 -25
- package/dist/lib/types.d.ts +0 -15
- /package/dist/{lib/analytics → analytics}/analyticsEventService.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/ga4GoogleAnalyticsEventTracking.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/handleDataLayerPush.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/helpers.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/types.d.ts +0 -0
- /package/dist/{lib/ipInfo → ipInfo}/index.d.ts +0 -0
- /package/dist/{lib/ipInfo → ipInfo}/types.d.ts +0 -0
- /package/dist/{lib/utilities → utilities}/assertValueCheckers.d.ts +0 -0
- /package/dist/{lib/utilities → utilities}/commonFunctions.d.ts +0 -0
- /package/dist/{lib/utilities → utilities}/cookies.d.ts +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BuildConfigOptions, Config, AnalyticsPlatform } from '../types';
|
|
2
|
+
declare const analyticsPlatform: AnalyticsPlatform;
|
|
3
|
+
declare const showMeBuildInAnalyticsPlatform: () => void;
|
|
4
|
+
declare const showMeBuildInEventActionPrefixList: () => void;
|
|
5
|
+
declare const showMeBuildInGlobalEventActionList: () => void;
|
|
6
|
+
declare let config: Config;
|
|
7
|
+
declare const buildConfig: (options: BuildConfigOptions) => void;
|
|
8
|
+
export { config, analyticsPlatform, buildConfig, showMeBuildInAnalyticsPlatform, showMeBuildInGlobalEventActionList, showMeBuildInEventActionPrefixList, };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,144 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
actionPrefix: string
|
|
28
|
-
globalAppEvent: string
|
|
29
|
-
previousGlobalAppEvent?: string
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// AllowedTypes type - Union type for allowed parameter types in events
|
|
33
|
-
export type AllowedTypes = string | number
|
|
34
|
-
|
|
35
|
-
// TrackAnalyticsEventOptions type - Options for tracking an analytics event
|
|
36
|
-
export type TrackAnalyticsEventOptions = {
|
|
37
|
-
data: Record<AllowedTypes, AllowedTypes>
|
|
38
|
-
eventNameInfo: EventNameInfo
|
|
39
|
-
analyticsType: string
|
|
40
|
-
userDataToHashKeyArray: Array<string> | null
|
|
41
|
-
dataLayerCheck: boolean
|
|
42
|
-
consoleLogData?: object
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// GlobalVars type - Represents global variables in analytics tracking
|
|
46
|
-
export type GlobalVars = {
|
|
47
|
-
app: string
|
|
48
|
-
device_category?: string | undefined
|
|
49
|
-
device_os?: string | undefined
|
|
50
|
-
device_browser?: string | undefined
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// DataLayer type - Represents the data layer for analytics events
|
|
54
|
-
export type DataLayer = {
|
|
55
|
-
event: string
|
|
56
|
-
globalVars: GlobalVars
|
|
57
|
-
journeyProps: Record<any, any>
|
|
58
|
-
userProps: Record<any, any>
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// ConsoleLogData type - Options for console logging analytics data
|
|
62
|
-
export type ConsoleLogData = {
|
|
63
|
-
showGlobalVars?: boolean
|
|
64
|
-
showJourneyPropsPayload?: boolean
|
|
65
|
-
showUserProps?: boolean
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// AnalyticsTrackerDataOptions interface - Options for analytics tracking
|
|
69
|
-
export interface AnalyticsTrackerDataOptions {
|
|
70
|
-
consoleLogData: ConsoleLogData | null
|
|
71
|
-
data: Record<any, any>
|
|
72
|
-
eventName: string
|
|
73
|
-
globalAppEvent: string
|
|
74
|
-
userDetails: Record<any, any>
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// HandleDataLayerPushOptions type - Options for handling data layer push
|
|
78
|
-
export interface HandleDataLayerPushOptions
|
|
79
|
-
extends AnalyticsTrackerDataOptions {
|
|
80
|
-
dataLayerCheck: boolean
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Ga4GoogleAnalyticsEventTracking type - Options for GA4 Google Analytics event tracking
|
|
84
|
-
export type Ga4GoogleAnalyticsEventTracking = AnalyticsTrackerDataOptions
|
|
85
|
-
|
|
86
|
-
// Platform type - Union type for supported analytics platforms
|
|
87
|
-
export type Platform = 'GOOGLE' | 'FACEBOOK' | 'DATALAYER_PUSH'
|
|
88
|
-
|
|
89
|
-
// Tokens type - Represents tokens used in the analytics configuration
|
|
90
|
-
export type Tokens = {
|
|
91
|
-
IP_INFO_TOKEN?: string
|
|
92
|
-
GA4_PUBLIC_API_SECRET?: string
|
|
93
|
-
GA4_PUBLIC_MEASUREMENT_ID?: string
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Config type - Represents the configuration for analytics tracking
|
|
97
|
-
export type Config = {
|
|
98
|
-
TOKENS?: Tokens
|
|
99
|
-
appName: string
|
|
100
|
-
appSessionCookieName: string
|
|
101
|
-
withDeviceInfo?: boolean
|
|
102
|
-
includeUserKeys: Array<string>
|
|
103
|
-
showMissingUserAttributesInConsole: boolean | undefined
|
|
104
|
-
withServerLocationInfo: boolean | undefined
|
|
105
|
-
eventActionPrefixList: Record<string, string>
|
|
106
|
-
analyticsGlobalEventActionList: Record<string, string>
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// BuildConfigOptions type - Options for building the analytics configuration
|
|
110
|
-
export type BuildConfigOptions = {
|
|
111
|
-
appName: string
|
|
112
|
-
appSessionCookieName: string
|
|
113
|
-
eventActionPrefix?: Record<string, string>
|
|
114
|
-
globalEventActionList?: Record<string, string>
|
|
115
|
-
includeUserKeys?: boolean
|
|
116
|
-
showMissingUserAttributesInConsole?: boolean
|
|
117
|
-
TOKENS?: Tokens
|
|
118
|
-
withDeviceInfo?: boolean
|
|
119
|
-
withServerLocationInfo?: boolean
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Function declarations
|
|
123
|
-
export const analyticsPlatform: {
|
|
124
|
-
[key in Platform]: Platform
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Function to log supported analytics platforms
|
|
128
|
-
export const showMeBuildInAnalyticsPlatform: () => void
|
|
129
|
-
|
|
130
|
-
export const analyticsEventActionPrefixList: Record<string, string>
|
|
131
|
-
|
|
132
|
-
// Function to log built-in event action prefix list
|
|
133
|
-
export const showMeBuildInEventActionPrefixList: () => void
|
|
134
|
-
|
|
135
|
-
export const analyticsGlobalEventActionList: Record<string, string>
|
|
136
|
-
|
|
137
|
-
// Function to log built-in global event action list
|
|
138
|
-
export const showMeBuildInGlobalEventActionList: () => void
|
|
139
|
-
|
|
140
|
-
export let config: Config
|
|
141
|
-
|
|
142
|
-
// Function to build the analytics configuration
|
|
143
|
-
export const buildConfig: (options: BuildConfigOptions) => void
|
|
144
|
-
}
|
|
1
|
+
import { ReactNode, Context } from 'react';
|
|
2
|
+
import type { ProviderStateProps, ProviderApiProps } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export { buildConfig } from './buildConfig';
|
|
5
|
+
export { trackAnalyticsEvent } from './analytics/analyticsEventService';
|
|
6
|
+
export declare const ContextState: Context<ProviderStateProps>;
|
|
7
|
+
export declare const ContextApi: Context<ProviderApiProps>;
|
|
8
|
+
declare type ReactMarketingProviderProps = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const ReactMarketingProvider: ({ children, }: ReactMarketingProviderProps) => JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* @property {string} appName
|
|
14
|
+
* @property {string} appSessionCookieName
|
|
15
|
+
* @property {object} analyticsPlatform
|
|
16
|
+
* @property {object} eventActionPrefixList
|
|
17
|
+
* @property {object} analyticsGlobalEventActionList
|
|
18
|
+
*/
|
|
19
|
+
export declare const useMarketingState: () => ProviderStateProps;
|
|
20
|
+
/**
|
|
21
|
+
* @property {function} trackAnalyticsEvent(options)
|
|
22
|
+
* @property {function} showMeBuildInAnalyticsPlatform
|
|
23
|
+
* @property {function} showMeBuildInEventActionPrefixList
|
|
24
|
+
* @property {function} showMeBuildInGlobalEventActionList
|
|
25
|
+
*/
|
|
26
|
+
export declare const useMarketingApi: () => ProviderApiProps;
|