@maxzima/wa-communicator 1.0.63 → 1.0.65

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.
@@ -1,11 +1,13 @@
1
1
  export declare enum GTMEventEnum {
2
2
  SIGN_UP_ONLINE = "sign_up_online",
3
3
  VERIFY_EMAIL_ONLINE = "verify_email_online",
4
- VERIFY_PHONE_ONLINE = "verify_phone_online"
4
+ VERIFY_PHONE_ONLINE = "verify_phone_online",
5
+ OPEN_SIGN_UP_POPUP = "open_sign_up_popup"
5
6
  }
6
7
  export declare enum GTMEventParamsEnum {
7
8
  PHONE = "phone",
8
9
  EMAIL = "email",
9
10
  GCL_ID = "gcl_id",
10
- USER_ID = "user_id"
11
+ USER_ID = "user_id",
12
+ VER = "ver"
11
13
  }
@@ -3,6 +3,7 @@ export var GTMEventEnum;
3
3
  GTMEventEnum["SIGN_UP_ONLINE"] = "sign_up_online";
4
4
  GTMEventEnum["VERIFY_EMAIL_ONLINE"] = "verify_email_online";
5
5
  GTMEventEnum["VERIFY_PHONE_ONLINE"] = "verify_phone_online";
6
+ GTMEventEnum["OPEN_SIGN_UP_POPUP"] = "open_sign_up_popup";
6
7
  })(GTMEventEnum || (GTMEventEnum = {}));
7
8
  export var GTMEventParamsEnum;
8
9
  (function (GTMEventParamsEnum) {
@@ -10,4 +11,5 @@ export var GTMEventParamsEnum;
10
11
  GTMEventParamsEnum["EMAIL"] = "email";
11
12
  GTMEventParamsEnum["GCL_ID"] = "gcl_id";
12
13
  GTMEventParamsEnum["USER_ID"] = "user_id";
14
+ GTMEventParamsEnum["VER"] = "ver";
13
15
  })(GTMEventParamsEnum || (GTMEventParamsEnum = {}));
@@ -5,5 +5,6 @@ export declare class AccountTracker {
5
5
  sendRegistrationSuccessEvent(eventParams: TAccountTrackerEventParams): void;
6
6
  sendVerifyPhoneSuccessEvent(eventParams: TAccountTrackerEventParams): void;
7
7
  sendVerifyEmailSuccessEvent(eventParams: TAccountTrackerEventParams): void;
8
+ sendSignupPopupOpenEvent(eventParams: TAccountTrackerEventParams): void;
8
9
  private sendGtmEvent;
9
10
  }
@@ -19,4 +19,7 @@ export class AccountTracker {
19
19
  sendVerifyEmailSuccessEvent(eventParams) {
20
20
  this.sendGtmEvent(GTMEventEnum.VERIFY_EMAIL_ONLINE, eventParams.gtm);
21
21
  }
22
+ sendSignupPopupOpenEvent(eventParams) {
23
+ this.sendGtmEvent(GTMEventEnum.OPEN_SIGN_UP_POPUP, eventParams.gtm);
24
+ }
22
25
  }
@@ -8,16 +8,23 @@ export type TAccountTrackerEventParams = {
8
8
  export type TAccountTrackerGtmEventParamsMapping = {
9
9
  [event in GTMEventEnum]?: TAccountTrackerGtmEventParams;
10
10
  };
11
- export type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpOnlineEventParams | TAccountTrackerGtmVerifyPhoneOnlineEventParams | TAccountTrackerGtmVerifyEmailOnlineEventParams;
11
+ export type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpOnlineEventParams | TAccountTrackerGtmVerifyPhoneOnlineEventParams | TAccountTrackerGtmVerifyEmailOnlineEventParams | TAccountTrackerGtmSignupPopupOpenEventParams;
12
12
  export type TAccountTrackerGtmSignUpOnlineEventParams = {
13
13
  [GTMEventParamsEnum.EMAIL]: string;
14
14
  [GTMEventParamsEnum.PHONE]: string;
15
15
  [GTMEventParamsEnum.GCL_ID]: string;
16
16
  [GTMEventParamsEnum.USER_ID]: string;
17
+ [GTMEventParamsEnum.VER]?: number;
17
18
  };
18
19
  export type TAccountTrackerGtmVerifyPhoneOnlineEventParams = {
19
20
  [GTMEventParamsEnum.GCL_ID]: string;
21
+ [GTMEventParamsEnum.VER]?: number;
20
22
  };
21
23
  export type TAccountTrackerGtmVerifyEmailOnlineEventParams = {
22
24
  [GTMEventParamsEnum.GCL_ID]: string;
25
+ [GTMEventParamsEnum.VER]?: number;
26
+ };
27
+ export type TAccountTrackerGtmSignupPopupOpenEventParams = {
28
+ [GTMEventParamsEnum.GCL_ID]: string;
29
+ [GTMEventParamsEnum.VER]?: number;
23
30
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.63",
2
+ "version": "1.0.65",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -2,6 +2,7 @@ export enum GTMEventEnum {
2
2
  SIGN_UP_ONLINE = 'sign_up_online',
3
3
  VERIFY_EMAIL_ONLINE = 'verify_email_online',
4
4
  VERIFY_PHONE_ONLINE = 'verify_phone_online',
5
+ OPEN_SIGN_UP_POPUP = 'open_sign_up_popup',
5
6
  }
6
7
 
7
8
  export enum GTMEventParamsEnum {
@@ -9,4 +10,5 @@ export enum GTMEventParamsEnum {
9
10
  EMAIL = 'email',
10
11
  GCL_ID = 'gcl_id',
11
12
  USER_ID = 'user_id',
13
+ VER = 'ver',
12
14
  }
@@ -20,6 +20,10 @@ export class AccountTracker {
20
20
  this.sendGtmEvent(GTMEventEnum.VERIFY_EMAIL_ONLINE, eventParams.gtm);
21
21
  }
22
22
 
23
+ public sendSignupPopupOpenEvent (eventParams: TAccountTrackerEventParams) {
24
+ this.sendGtmEvent(GTMEventEnum.OPEN_SIGN_UP_POPUP, eventParams.gtm);
25
+ }
26
+
23
27
  private sendGtmEvent = (event: GTMEventEnum, eventParams: TAccountTrackerGtmEventParamsMapping) => {
24
28
  if (!Array.isArray(this.props.gtmDataLayer)) {
25
29
  return;
@@ -15,19 +15,28 @@ export type TAccountTrackerGtmEventParamsMapping = {
15
15
  export type TAccountTrackerGtmEventParams =
16
16
  | TAccountTrackerGtmSignUpOnlineEventParams
17
17
  | TAccountTrackerGtmVerifyPhoneOnlineEventParams
18
- | TAccountTrackerGtmVerifyEmailOnlineEventParams;
18
+ | TAccountTrackerGtmVerifyEmailOnlineEventParams
19
+ | TAccountTrackerGtmSignupPopupOpenEventParams;
19
20
 
20
21
  export type TAccountTrackerGtmSignUpOnlineEventParams = {
21
22
  [GTMEventParamsEnum.EMAIL]: string;
22
23
  [GTMEventParamsEnum.PHONE]: string;
23
24
  [GTMEventParamsEnum.GCL_ID]: string;
24
25
  [GTMEventParamsEnum.USER_ID]: string;
26
+ [GTMEventParamsEnum.VER]?: number;
25
27
  };
26
28
 
27
29
  export type TAccountTrackerGtmVerifyPhoneOnlineEventParams = {
28
30
  [GTMEventParamsEnum.GCL_ID]: string;
31
+ [GTMEventParamsEnum.VER]?: number;
29
32
  };
30
33
 
31
34
  export type TAccountTrackerGtmVerifyEmailOnlineEventParams = {
32
35
  [GTMEventParamsEnum.GCL_ID]: string;
36
+ [GTMEventParamsEnum.VER]?: number;
33
37
  };
38
+
39
+ export type TAccountTrackerGtmSignupPopupOpenEventParams = {
40
+ [GTMEventParamsEnum.GCL_ID]: string;
41
+ [GTMEventParamsEnum.VER]?: number;
42
+ }
@@ -28,4 +28,9 @@ describe('AccountTracker', () => {
28
28
  accountTracker.sendVerifyEmailSuccessEvent(registrationSuccessEventParams);
29
29
  expect(mockGtmDataLayer[2]).toEqual({ ...registrationSuccessEvents.gtm.verify_email_online });
30
30
  });
31
+
32
+ test('sendSignupPopupOpenEvent', () => {
33
+ accountTracker.sendSignupPopupOpenEvent(registrationSuccessEventParams);
34
+ expect(mockGtmDataLayer[3]).toEqual({...registrationSuccessEvents.gtm.open_sign_up_popup});
35
+ });
31
36
  });
@@ -17,6 +17,10 @@ const registrationSuccessEvents = {
17
17
  event: 'verify_email_online',
18
18
  gcl_id: communicatorTestData.gcId,
19
19
  },
20
+ open_sign_up_popup: {
21
+ event: 'open_sign_up_popup',
22
+ gcl_id: communicatorTestData.gcId,
23
+ },
20
24
  },
21
25
  };
22
26
 
@@ -34,6 +38,9 @@ const registrationSuccessEventParams = {
34
38
  verify_email_online: {
35
39
  gcl_id: communicatorTestData.gcId,
36
40
  },
41
+ open_sign_up_popup: {
42
+ gcl_id: communicatorTestData.gcId,
43
+ }
37
44
  },
38
45
  };
39
46