@maxzima/wa-communicator 1.0.35 → 1.0.37
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/engine/AccountTracker/Enums/AccountTrackerEnum.d.ts +6 -2
- package/dist/engine/AccountTracker/Public/AccountTracker.js +1 -0
- package/dist/engine/AccountTracker/Types/TAccountTracker.d.ts +6 -1
- package/dist/engine/Communicator/Public/Communicator.js +2 -2
- package/dist/types/TCommunicator.d.ts +1 -1
- package/package.json +1 -1
- package/src/engine/AccountTracker/Enums/AccountTrackerEnum.ts +4 -0
- package/src/engine/AccountTracker/Public/AccountTracker.ts +1 -0
- package/src/engine/AccountTracker/Types/TAccountTracker.ts +7 -1
- package/src/engine/Communicator/Public/Communicator.ts +2 -2
- package/src/types/TCommunicator.ts +1 -1
- package/test/testunits/accountTracker/events.ts +10 -0
- package/test/testunits/communicator/general.ts +2 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
declare const enum GTMEventEnum {
|
|
2
|
-
SIGN_UP = "sign_up"
|
|
2
|
+
SIGN_UP = "sign_up",
|
|
3
|
+
SIGN_UP_ONLINE = "sign_up_online"
|
|
3
4
|
}
|
|
4
5
|
declare const enum GTMEventParamsEnum {
|
|
5
6
|
GCLID = "gclid",
|
|
6
7
|
PHONE = "phone",
|
|
7
|
-
EMAIL = "email"
|
|
8
|
+
EMAIL = "email",
|
|
9
|
+
ORIGIN = "origin",
|
|
10
|
+
SEND_TO = "send_to",
|
|
11
|
+
GCL_ID = "gcl_id"
|
|
8
12
|
}
|
|
9
13
|
declare const enum LintrkActionTypeEnum {
|
|
10
14
|
TRACK = "track"
|
|
@@ -11,9 +11,14 @@ declare type TAccountTrackerEventParams = {
|
|
|
11
11
|
declare type TAccountTrackerGtmEventParamsMapping = {
|
|
12
12
|
[event in GTMEventEnum]: TAccountTrackerGtmEventParams;
|
|
13
13
|
};
|
|
14
|
-
declare type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams;
|
|
14
|
+
declare type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams | TAccountTrackerGtmSignUpOnlineEventParams;
|
|
15
15
|
declare type TAccountTrackerGtmSignUpEventParams = {
|
|
16
16
|
[GTMEventParamsEnum.GCLID]: string;
|
|
17
17
|
[GTMEventParamsEnum.EMAIL]: string;
|
|
18
18
|
[GTMEventParamsEnum.PHONE]: string;
|
|
19
19
|
};
|
|
20
|
+
declare type TAccountTrackerGtmSignUpOnlineEventParams = {
|
|
21
|
+
[GTMEventParamsEnum.ORIGIN]: string;
|
|
22
|
+
[GTMEventParamsEnum.SEND_TO]: string;
|
|
23
|
+
[GTMEventParamsEnum.GCL_ID]: string;
|
|
24
|
+
};
|
|
@@ -136,10 +136,10 @@ export class Communicator {
|
|
|
136
136
|
this.sseAuth.addEventListener('error', (event) => {
|
|
137
137
|
const responseData = jsonParse(event.data || '');
|
|
138
138
|
if (this.props.env !== 'prod') {
|
|
139
|
-
console.log('sse error', event, responseData
|
|
139
|
+
console.log('sse error', event, responseData);
|
|
140
140
|
}
|
|
141
141
|
if (typeof data.onError === "function") {
|
|
142
|
-
data.onError(
|
|
142
|
+
data.onError();
|
|
143
143
|
}
|
|
144
144
|
this.closeSSEAuth();
|
|
145
145
|
});
|
|
@@ -80,7 +80,7 @@ declare type TSetupSSERequestData = {
|
|
|
80
80
|
requestId: string;
|
|
81
81
|
phoneNumber: string;
|
|
82
82
|
onOpen: () => void;
|
|
83
|
-
onError: (
|
|
83
|
+
onError: () => void;
|
|
84
84
|
onMessage: (responseData: TSSEResponseData) => void;
|
|
85
85
|
};
|
|
86
86
|
declare type TSSEResponseData = {
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
const enum GTMEventEnum {
|
|
2
2
|
SIGN_UP = 'sign_up',
|
|
3
|
+
SIGN_UP_ONLINE = 'sign_up_online',
|
|
3
4
|
}
|
|
4
5
|
|
|
5
6
|
const enum GTMEventParamsEnum {
|
|
6
7
|
GCLID = 'gclid',
|
|
7
8
|
PHONE = 'phone',
|
|
8
9
|
EMAIL = 'email',
|
|
10
|
+
ORIGIN = 'origin',
|
|
11
|
+
SEND_TO = 'send_to',
|
|
12
|
+
GCL_ID = 'gcl_id',
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
const enum LintrkActionTypeEnum {
|
|
@@ -7,6 +7,7 @@ export class AccountTracker {
|
|
|
7
7
|
|
|
8
8
|
public sendRegistrationSuccessEvent (eventParams: TAccountTrackerEventParams) {
|
|
9
9
|
this.sendGtmEvent(GTMEventEnum.SIGN_UP, eventParams.gtm);
|
|
10
|
+
this.sendGtmEvent(GTMEventEnum.SIGN_UP_ONLINE, eventParams.gtm);
|
|
10
11
|
this.sendLinkedInEvent(LintrkEventIdEnum.REGISTRATION);
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -15,10 +15,16 @@ type TAccountTrackerGtmEventParamsMapping = {
|
|
|
15
15
|
[event in GTMEventEnum]: TAccountTrackerGtmEventParams;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams;
|
|
18
|
+
type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams | TAccountTrackerGtmSignUpOnlineEventParams;
|
|
19
19
|
|
|
20
20
|
type TAccountTrackerGtmSignUpEventParams = {
|
|
21
21
|
[GTMEventParamsEnum.GCLID]: string;
|
|
22
22
|
[GTMEventParamsEnum.EMAIL]: string;
|
|
23
23
|
[GTMEventParamsEnum.PHONE]: string;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
type TAccountTrackerGtmSignUpOnlineEventParams = {
|
|
27
|
+
[GTMEventParamsEnum.ORIGIN]: string;
|
|
28
|
+
[GTMEventParamsEnum.SEND_TO]: string;
|
|
29
|
+
[GTMEventParamsEnum.GCL_ID]: string;
|
|
30
|
+
}
|
|
@@ -141,10 +141,10 @@ export class Communicator {
|
|
|
141
141
|
this.sseAuth.addEventListener('error', (event: MessageEvent) => {
|
|
142
142
|
const responseData: TSSEResponseData = jsonParse(event.data || '');
|
|
143
143
|
if (this.props.env !== 'prod') {
|
|
144
|
-
console.log('sse error', event, responseData
|
|
144
|
+
console.log('sse error', event, responseData);
|
|
145
145
|
}
|
|
146
146
|
if (typeof data.onError === "function") {
|
|
147
|
-
data.onError(
|
|
147
|
+
data.onError();
|
|
148
148
|
}
|
|
149
149
|
this.closeSSEAuth();
|
|
150
150
|
});
|
|
@@ -7,6 +7,11 @@ const registrationSuccessEvents = {
|
|
|
7
7
|
gclid: communicatorTestData.gcId,
|
|
8
8
|
email: communicatorTestData.email,
|
|
9
9
|
phone: communicatorTestData.phoneNumber,
|
|
10
|
+
},
|
|
11
|
+
sign_up_online: {
|
|
12
|
+
event: 'sign_up_online',
|
|
13
|
+
send_to: communicatorTestData.gaId,
|
|
14
|
+
gcl_id: communicatorTestData.gcId,
|
|
10
15
|
}
|
|
11
16
|
},
|
|
12
17
|
linkedIn: {
|
|
@@ -23,6 +28,11 @@ const registrationSuccessEventParams = {
|
|
|
23
28
|
gclid: communicatorTestData.gcId,
|
|
24
29
|
email: communicatorTestData.email,
|
|
25
30
|
phone: communicatorTestData.phoneNumber,
|
|
31
|
+
},
|
|
32
|
+
sign_up_online: {
|
|
33
|
+
origin: communicatorTestData.gtmId,
|
|
34
|
+
send_to: communicatorTestData.ga4Id,
|
|
35
|
+
gcl_id: communicatorTestData.gcId,
|
|
26
36
|
}
|
|
27
37
|
}
|
|
28
38
|
}
|