@maxzima/wa-communicator 1.0.17 → 1.0.19

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,4 +1,7 @@
1
1
  declare const enum GTMEventEnum {
2
+ VERIFY_CONTACT = "verify_contact"
3
+ }
4
+ declare const enum GTMEventContactEnum {
2
5
  PHONE = "phone",
3
6
  EMAIL = "email"
4
7
  }
@@ -1,11 +1,12 @@
1
1
  export class AccountTracker {
2
2
  constructor(props) {
3
- this.sendGtmEvent = (event) => {
4
- if (typeof this.props.gtmDataLayer === 'undefined' || !this.props.gtmId) {
3
+ this.sendGtmEvent = (event, contact) => {
4
+ if (typeof this.props.gtmDataLayer === 'undefined') {
5
5
  return;
6
6
  }
7
7
  this.props.gtmDataLayer.push({
8
8
  event,
9
+ contact,
9
10
  origin: this.props.origin || null,
10
11
  });
11
12
  };
@@ -20,11 +21,11 @@ export class AccountTracker {
20
21
  this.props = props;
21
22
  }
22
23
  sendPhoneVerifyEvent() {
23
- this.sendGtmEvent("phone");
24
+ this.sendGtmEvent("verify_contact", "phone");
24
25
  this.sendLinkedInEvent(8612332);
25
26
  }
26
27
  sendEmailVerifyEvent() {
27
- this.sendGtmEvent("email");
28
+ this.sendGtmEvent("verify_contact", "email");
28
29
  this.sendLinkedInEvent(8612340);
29
30
  }
30
31
  sendRegistrationSuccessEvent() {
@@ -5,5 +5,4 @@ declare type TAccountTrackerProps = {
5
5
  origin?: string;
6
6
  gtmDataLayer?: object[];
7
7
  lintrk?: (action: LintrkActionTypeEnum, options: TLintrkOptions) => void;
8
- gtmId?: string;
9
8
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.17",
2
+ "version": "1.0.19",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -1,4 +1,8 @@
1
1
  const enum GTMEventEnum {
2
+ VERIFY_CONTACT = 'verify_contact',
3
+ }
4
+
5
+ const enum GTMEventContactEnum {
2
6
  PHONE = 'phone',
3
7
  EMAIL = 'email',
4
8
  }
@@ -6,12 +6,12 @@ export class AccountTracker {
6
6
  }
7
7
 
8
8
  public sendPhoneVerifyEvent () {
9
- this.sendGtmEvent(GTMEventEnum.PHONE);
9
+ this.sendGtmEvent(GTMEventEnum.VERIFY_CONTACT, GTMEventContactEnum.PHONE);
10
10
  this.sendLinkedInEvent(LintrkEventIdEnum.PHONE);
11
11
  }
12
12
 
13
13
  public sendEmailVerifyEvent () {
14
- this.sendGtmEvent(GTMEventEnum.EMAIL);
14
+ this.sendGtmEvent(GTMEventEnum.VERIFY_CONTACT, GTMEventContactEnum.EMAIL);
15
15
  this.sendLinkedInEvent(LintrkEventIdEnum.EMAIL);
16
16
  }
17
17
 
@@ -19,13 +19,14 @@ export class AccountTracker {
19
19
  this.sendLinkedInEvent(LintrkEventIdEnum.REGISTRATION);
20
20
  }
21
21
 
22
- private sendGtmEvent = (event: GTMEventEnum) => {
23
- if (typeof this.props.gtmDataLayer === 'undefined' || !this.props.gtmId) {
22
+ private sendGtmEvent = (event: GTMEventEnum, contact: GTMEventContactEnum) => {
23
+ if (typeof this.props.gtmDataLayer === 'undefined') {
24
24
  return;
25
25
  }
26
26
 
27
27
  this.props.gtmDataLayer.push({
28
28
  event,
29
+ contact,
29
30
  origin: this.props.origin || null,
30
31
  });
31
32
  };
@@ -6,5 +6,4 @@ type TAccountTrackerProps = {
6
6
  origin?: string;
7
7
  gtmDataLayer?: object[];
8
8
  lintrk?: (action: LintrkActionTypeEnum, options: TLintrkOptions) => void;
9
- gtmId?: string;
10
9
  }
@@ -2,7 +2,8 @@ import {accountTrackerInitPropsNormal} from "./general";
2
2
 
3
3
  const phoneVerifyEvents = {
4
4
  gtm: {
5
- event: 'phone',
5
+ event: 'verify_contact',
6
+ contact: 'phone',
6
7
  origin: accountTrackerInitPropsNormal.origin,
7
8
  },
8
9
  linkedIn: {
@@ -15,7 +16,8 @@ const phoneVerifyEvents = {
15
16
 
16
17
  const emailVerifyEvents = {
17
18
  gtm: {
18
- event: 'email',
19
+ event: 'verify_contact',
20
+ contact: 'email',
19
21
  origin: accountTrackerInitPropsNormal.origin,
20
22
  },
21
23
  linkedIn: {
@@ -1,6 +1,5 @@
1
1
  const accountTrackerInitPropsNormal = {
2
2
  origin: '_origin_',
3
- gtmId: '_gtmId_'
4
3
  };
5
4
 
6
5
  export {