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.
@@ -0,0 +1,104 @@
1
+ export declare type Event = {
2
+ name: string;
3
+ params: Record<AllowedTypes, AllowedTypes>;
4
+ };
5
+ export declare type GooglePayload = {
6
+ non_personalized_ads: boolean;
7
+ client_id: string;
8
+ user_id: string;
9
+ user_properties: {
10
+ user_id: string;
11
+ user_type: string;
12
+ client_id: string;
13
+ };
14
+ events: Event[];
15
+ };
16
+ export declare type EventNameInfo = {
17
+ eventName: string;
18
+ description?: string;
19
+ actionPrefix: string;
20
+ globalAppEvent: string;
21
+ previousGlobalAppEvent?: string;
22
+ };
23
+ export declare type AllowedTypes = string | number;
24
+ export declare type TrackAnalyticsEventOptions = {
25
+ data: Record<AllowedTypes, AllowedTypes>;
26
+ eventNameInfo: EventNameInfo;
27
+ analyticsType: string;
28
+ userDataToHashKeyArray: Array<string> | null;
29
+ dataLayerCheck: boolean;
30
+ consoleLogData?: object;
31
+ };
32
+ export declare type GlobalVars = {
33
+ app: string;
34
+ device_category?: string | undefined;
35
+ device_os?: string | undefined;
36
+ device_browser?: string | undefined;
37
+ };
38
+ export declare type DataLayer = {
39
+ event: string;
40
+ globalVars: GlobalVars;
41
+ journeyProps: Record<any, any>;
42
+ userProps: Record<any, any>;
43
+ };
44
+ export declare type ConsoleLogData = {
45
+ showGlobalVars?: boolean;
46
+ showJourneyPropsPayload?: boolean;
47
+ showUserProps?: boolean;
48
+ };
49
+ export interface AnalyticsTrackerDataOptions {
50
+ consoleLogData: ConsoleLogData | null;
51
+ data: Record<any, any>;
52
+ eventName: string;
53
+ globalAppEvent: string;
54
+ userDetails: Record<any, any>;
55
+ }
56
+ export interface HandleDataLayerPushOptions extends AnalyticsTrackerDataOptions {
57
+ dataLayerCheck: boolean;
58
+ }
59
+ export declare type Ga4GoogleAnalyticsEventTracking = AnalyticsTrackerDataOptions;
60
+ export declare type Platform = 'GOOGLE' | 'FACEBOOK' | 'DATALAYER_PUSH';
61
+ export declare type AnalyticsPlatform = {
62
+ [key in Platform]: Platform;
63
+ };
64
+ export declare type Tokens = {
65
+ IP_INFO_TOKEN?: string;
66
+ GA4_PUBLIC_API_SECRET?: string;
67
+ GA4_PUBLIC_MEASUREMENT_ID?: string;
68
+ };
69
+ export declare type Config = {
70
+ TOKENS?: Tokens;
71
+ appName: string;
72
+ appSessionCookieName: string;
73
+ withDeviceInfo?: boolean;
74
+ includeUserKeys: Array<string>;
75
+ showMissingUserAttributesInConsole: boolean | undefined;
76
+ withServerLocationInfo: boolean | undefined;
77
+ eventActionPrefixList: Record<string, string>;
78
+ analyticsGlobalEventActionList: Record<string, string>;
79
+ };
80
+ export declare type BuildConfigOptions = {
81
+ appName: string;
82
+ appSessionCookieName: string;
83
+ eventActionPrefix?: Record<string, string>;
84
+ globalEventActionList?: Record<string, string>;
85
+ includeUserKeys?: Array<string> | undefined;
86
+ showMissingUserAttributesInConsole?: boolean;
87
+ TOKENS?: Tokens;
88
+ withDeviceInfo?: boolean;
89
+ withServerLocationInfo?: boolean;
90
+ };
91
+ export declare let config: Config;
92
+ export declare type ProviderStateProps = {
93
+ appName: string;
94
+ appSessionCookieName: string;
95
+ analyticsPlatform: AnalyticsPlatform;
96
+ eventActionPrefixList: Record<string, string>;
97
+ analyticsGlobalEventActionList: Record<string, string>;
98
+ };
99
+ export declare type ProviderApiProps = {
100
+ trackAnalyticsEvent: (options: TrackAnalyticsEventOptions) => Promise<void>;
101
+ showMeBuildInAnalyticsPlatform: () => void;
102
+ showMeBuildInEventActionPrefixList: () => void;
103
+ showMeBuildInGlobalEventActionList: () => void;
104
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-marketing-tools",
3
- "version": "0.2.9",
3
+ "version": "0.3.1",
4
4
  "description": "React Marketing Tools are a set of tools to make it easier for you to implement analytics and track user journeys, interactions throughout your App. using dataLayer/Google Tag Manager, GA4 fetch directly or coming soon facebook pixel.",
5
5
  "license": "MIT",
6
6
  "author": "bronz3beard <exempli.gratia.webdesign@gmail.com> (https://www.heyrory.com/)",
@@ -1,10 +0,0 @@
1
- import { BuildConfigOptions, Config, Platform } from './types';
2
- export declare const analyticsPlatform: Platform;
3
- export declare const showMeBuildInAnalyticsPlatform: () => void;
4
- export declare const analyticsEventActionPrefixList: Record<string, string>;
5
- export declare const showMeBuildInEventActionPrefixList: () => void;
6
- export declare const analyticsGlobalEventActionList: Record<string, string>;
7
- export declare const showMeBuildInGlobalEventActionList: () => void;
8
- export declare let config: Config;
9
- declare const buildConfig: (options: BuildConfigOptions) => void;
10
- export { buildConfig };
@@ -1,28 +0,0 @@
1
- export declare type Platform = Record<string, string>;
2
- export declare type Tokens = {
3
- IP_INFO_TOKEN?: string;
4
- GA4_PUBLIC_API_SECRET?: string;
5
- GA4_PUBLIC_MEASUREMENT_ID?: string;
6
- };
7
- export declare type Config = {
8
- TOKENS?: Tokens;
9
- appName: string;
10
- appSessionCookieName: string;
11
- withDeviceInfo?: boolean;
12
- includeUserKeys: Array<string>;
13
- showMissingUserAttributesInConsole: boolean | undefined;
14
- withServerLocationInfo: boolean | undefined;
15
- eventActionPrefixList: Record<string, string>;
16
- analyticsGlobalEventActionList: Record<string, string>;
17
- };
18
- export declare type BuildConfigOptions = {
19
- appName: string;
20
- appSessionCookieName: string;
21
- eventActionPrefix: Record<string, string>;
22
- globalEventActionList: Record<string, string>;
23
- includeUserKeys: Array<string>;
24
- showMissingUserAttributesInConsole: boolean | undefined;
25
- TOKENS?: Tokens;
26
- withDeviceInfo: boolean | undefined;
27
- withServerLocationInfo: boolean | undefined;
28
- };
@@ -1,25 +0,0 @@
1
- import { ReactNode, Context } from 'react';
2
- import { ProviderApiProps, ProviderStateProps } from './types';
3
- export { buildConfig, analyticsPlatform } from './buildConfig';
4
- export { trackAnalyticsEvent } from './analytics/analyticsEventService';
5
- export declare const ContextState: Context<ProviderStateProps>;
6
- export declare const ContextApi: Context<ProviderApiProps>;
7
- declare type ReactMarketingProviderProps = {
8
- children: ReactNode;
9
- };
10
- export declare const ReactMarketingProvider: ({ children, }: ReactMarketingProviderProps) => JSX.Element;
11
- /**
12
- * @property {string} appName
13
- * @property {string} appSessionCookieName
14
- * @property {object} analyticsPlatform
15
- * @property {object} eventActionPrefixList
16
- * @property {object} analyticsGlobalEventActionList
17
- */
18
- export declare const useMarketingState: () => ProviderStateProps;
19
- /**
20
- * @property {function} trackAnalyticsEvent(options)
21
- * @property {function} showMeBuildInAnalyticsPlatform
22
- * @property {function} showMeBuildInEventActionPrefixList
23
- * @property {function} showMeBuildInGlobalEventActionList
24
- */
25
- export declare const useMarketingApi: () => ProviderApiProps;
@@ -1,15 +0,0 @@
1
- import { TrackAnalyticsEventOptions } from './analytics/types';
2
- import { Platform } from './buildConfig/types';
3
- export declare type ProviderStateProps = {
4
- appName: string;
5
- appSessionCookieName: string;
6
- analyticsPlatform: Platform;
7
- eventActionPrefixList: Record<string, string>;
8
- analyticsGlobalEventActionList: Record<string, string>;
9
- };
10
- export declare type ProviderApiProps = {
11
- trackAnalyticsEvent: (options: TrackAnalyticsEventOptions) => Promise<void>;
12
- showMeBuildInAnalyticsPlatform: () => void;
13
- showMeBuildInEventActionPrefixList: () => void;
14
- showMeBuildInGlobalEventActionList: () => void;
15
- };
File without changes
File without changes
File without changes
File without changes
File without changes