@salesforcedevs/dx-components 1.3.45 → 1.3.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.45",
3
+ "version": "1.3.46",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -40,5 +40,5 @@
40
40
  "eventsourcemock": "^2.0.0",
41
41
  "luxon": "^3.1.0"
42
42
  },
43
- "gitHead": "b2340b9de4e809097ee2f5c5d1bff87b5bc3aab6"
43
+ "gitHead": "decc9a3791a30eb8d16fb7cffb3adf7092ab863b"
44
44
  }
@@ -1,6 +1,7 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
3
  import { toJson } from "dxUtils/normalizers";
4
+ import { track } from "dxUtils/analytics";
4
5
 
5
6
  export default class CardTrial extends LightningElement {
6
7
  @api badgeBackgroundColor?: string = "indigo-vibrant-90";
@@ -97,13 +98,26 @@ export default class CardTrial extends LightningElement {
97
98
  this._modalOpen = !this._modalOpen;
98
99
  }
99
100
 
100
- private handleClick() {
101
+ private handleClick(e: PointerEvent) {
101
102
  // card is clickable only if it doesn't contain buttons (for accessibility reasons)
102
103
  if (!this.hasButtons) {
103
104
  window.location.assign(this.href);
105
+ if (this.href.includes("signup")) {
106
+ this.handleSignUpClick(e);
107
+ }
104
108
  }
105
109
  }
106
110
 
111
+ private handleSignUpClick(e: PointerEvent) {
112
+ track(e.currentTarget!, "custEv_signupStart", {
113
+ click_text: this.label,
114
+ element_title: this.title,
115
+ element_type: "card",
116
+ click_url: this.href,
117
+ content_category: "cta"
118
+ });
119
+ }
120
+
107
121
  private isExternalURL(url: string | undefined): boolean {
108
122
  if (!url) {
109
123
  return false;
@@ -31,6 +31,7 @@
31
31
  class="button-cta"
32
32
  size="large"
33
33
  href={href}
34
+ onclick={handleSignUpClick}
34
35
  variant="primary"
35
36
  font="sans"
36
37
  icon-symbol={buttonIcon}
@@ -1,5 +1,6 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import { toJson } from "dxUtils/normalizers";
3
+ import { track } from "dxUtils/analytics";
3
4
 
4
5
  export default class CardTrial extends LightningElement {
5
6
  @api badgeBackgroundColor?: string = "indigo-vibrant-90";
@@ -64,4 +65,16 @@ export default class CardTrial extends LightningElement {
64
65
  private handleModalClose() {
65
66
  this.dispatchEvent(new CustomEvent("togglemodal"));
66
67
  }
68
+
69
+ private handleSignUpClick(e: PointerEvent) {
70
+ if (this.href.includes("signup")) {
71
+ track(e.currentTarget!, "custEv_signupStart", {
72
+ click_text: this.buttonCta,
73
+ element_title: this.title,
74
+ element_type: "card",
75
+ click_url: this.href,
76
+ content_category: "cta"
77
+ });
78
+ }
79
+ }
67
80
  }
@@ -20,6 +20,14 @@ const VALID_BRANDS = [
20
20
  "success"
21
21
  ];
22
22
 
23
+ export const ANALYTICS_INFO = {
24
+ click_text: "Sign Up",
25
+ element_title: "Sign Up Header Button",
26
+ elementType: "button",
27
+ element_type: "internal",
28
+ content_category: "cta"
29
+ };
30
+
23
31
  export abstract class HeaderBase extends LightningElement {
24
32
  @api bailHref?: string | null = null;
25
33
  @api bailLabel?: string | null = null;
@@ -194,11 +202,8 @@ export abstract class HeaderBase extends LightningElement {
194
202
 
195
203
  private handleSignUpClick(e: PointerEvent) {
196
204
  track(e.currentTarget!, "custEv_browseTrialsClick", {
197
- clickText: "browse trials",
198
- clickUrl: this.signupLink,
199
- elementTitle: "dx-button",
200
- elementType: "button",
201
- contentCategory: "cta"
205
+ ...ANALYTICS_INFO,
206
+ click_url: this.signupLink
202
207
  });
203
208
  }
204
209