@salesforcedevs/mrkt-components 0.54.6 → 0.62.0
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/mrkt-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0",
|
|
4
4
|
"description": "Marketing Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/classnames": "^2.2.10"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "1f71de910c147205b305cdc5df4a9591da0d98bb"
|
|
19
19
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<span if:true={subtitle} class="subtitle dx-text-body-2">
|
|
6
6
|
{subtitle}
|
|
7
7
|
</span>
|
|
8
|
-
<dx-button href={buttonHref}>{buttonText}</dx-button>
|
|
8
|
+
<dx-button href={buttonHref} onclick={handleCtaClick}>{buttonText}</dx-button>
|
|
9
9
|
</div>
|
|
10
10
|
<div class="img-container" if:true={hasImages}>
|
|
11
11
|
<img src={imgSrcLeft} alt="" />
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { api, LightningElement } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
+
import { track } from "dxUtils/analytics";
|
|
4
|
+
|
|
5
|
+
export const ANALYTICS_EVENT_NAME = "custEv_ctaButtonClick";
|
|
6
|
+
|
|
7
|
+
export const ANALYTICS_BASE_PAYLOAD = {
|
|
8
|
+
elementType: "button",
|
|
9
|
+
destinationType: "internal",
|
|
10
|
+
ctaClick: true
|
|
11
|
+
};
|
|
3
12
|
|
|
4
13
|
export default class CTASection extends LightningElement {
|
|
5
14
|
@api buttonHref!: string;
|
|
@@ -21,4 +30,15 @@ export default class CTASection extends LightningElement {
|
|
|
21
30
|
this.hasImages && "has-images"
|
|
22
31
|
);
|
|
23
32
|
}
|
|
33
|
+
|
|
34
|
+
private handleCtaClick(e: PointerEvent) {
|
|
35
|
+
const payload = {
|
|
36
|
+
...ANALYTICS_BASE_PAYLOAD,
|
|
37
|
+
itemTitle: this.title,
|
|
38
|
+
clickText: this.buttonText,
|
|
39
|
+
clickUrl: this.buttonHref
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
track(e.currentTarget!, ANALYTICS_EVENT_NAME, payload);
|
|
43
|
+
}
|
|
24
44
|
}
|