@maxzima/wa-communicator 1.0.36 → 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.
@@ -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"
@@ -23,6 +23,7 @@ export class AccountTracker {
23
23
  }
24
24
  sendRegistrationSuccessEvent(eventParams) {
25
25
  this.sendGtmEvent("sign_up", eventParams.gtm);
26
+ this.sendGtmEvent("sign_up_online", eventParams.gtm);
26
27
  this.sendLinkedInEvent(8612308);
27
28
  }
28
29
  }
@@ -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
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.36",
2
+ "version": "1.0.37",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -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
+ }
@@ -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
  }
@@ -27,6 +27,8 @@ const communicatorTestData = {
27
27
  accessToken: '_accessToken_',
28
28
  hash: '_hash_',
29
29
  gaId: '_gaId_',
30
+ ga4Id: '_ga4Id_',
31
+ gtmId: '_gtmId_',
30
32
  origin: '_origin_',
31
33
  gcId: '_gcId_',
32
34
  utmSource: '_utmSource_',