@salesforcedevs/dw-components 1.3.51 → 1.3.53

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/dw-components",
3
- "version": "1.3.51",
3
+ "version": "1.3.53",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -29,6 +29,7 @@
29
29
  icon-sprite="general"
30
30
  href="https://developer.salesforce.com/blogs/feed"
31
31
  class="button"
32
+ onclick={rssOnClick}
32
33
  >
33
34
  Subscribe to RSS
34
35
  </dx-button>
@@ -6,12 +6,11 @@ import { PostsGrid } from "dwBaseElements/postsGrid";
6
6
  const BLOG_SUBSCRIBE_HREF = "https://developer.salesforce.com/blogs/feed";
7
7
 
8
8
  const ANALYTICS_INFO = {
9
- itemTitle: "Blogs RSS Subscribe Button",
10
- elementType: "button",
11
- destinationType: "internal",
12
- clickText: "Subscribe",
13
- clickUrl: BLOG_SUBSCRIBE_HREF,
14
- ctaClick: true
9
+ click_text: "Subscribe to RSS",
10
+ element_title: "dx-button",
11
+ click_url: BLOG_SUBSCRIBE_HREF,
12
+ element_type: "link",
13
+ content_category: "cta"
15
14
  };
16
15
 
17
16
  export default class BlogsGrid extends PostsGrid {
@@ -23,6 +22,6 @@ export default class BlogsGrid extends PostsGrid {
23
22
 
24
23
  rssOnClick(event: Event): void {
25
24
  track(event.target!, "custEv_ctaButtonClick", ANALYTICS_INFO);
26
- window.location.href = BLOG_SUBSCRIBE_HREF;
25
+ track(event.target!, "custEv_linkClick", ANALYTICS_INFO);
27
26
  }
28
27
  }
@@ -113,6 +113,7 @@
113
113
  icon-symbol="new_window"
114
114
  variant="inline"
115
115
  href={item.href}
116
+ onclick={handleReadItClick}
116
117
  >
117
118
  {item.buttonText}
118
119
  </dx-button>
@@ -5,6 +5,7 @@ import orderBy from "lodash.orderby";
5
5
  import cloneDeep from "lodash.clonedeep";
6
6
  import { DocsTile, DropdownItem, CodeSample } from "typings/custom";
7
7
  import { toJson } from "dxUtils/normalizers";
8
+ import { track } from "dxUtils/analytics";
8
9
 
9
10
  const PRODUCT_FILTER_ALL_PRODUCTS = "all products";
10
11
  const LANGUAGE_FILTER_LABEL = "Type";
@@ -36,6 +37,7 @@ export default class CodeSamplesGrid extends LightningElement {
36
37
  private isMobile = "(min-width: 401px) and (max-width: 1023px)";
37
38
  private isMobileSmall = "(max-width: 400px)";
38
39
  private showSourcesFilter = false;
40
+ private filteredItemsSelected: boolean = false;
39
41
  private filtersDefaultValue = {
40
42
  selectedSourceFilter: [],
41
43
  selectedTypeFilter: [],
@@ -111,6 +113,18 @@ export default class CodeSamplesGrid extends LightningElement {
111
113
  this.matchMobile.removeEventListener("change", this.handleView);
112
114
  this.matchMobileSmall.removeEventListener("change", this.handleView);
113
115
  window.removeEventListener("popstate", this.handleURLStateChange);
116
+
117
+ if (!this.filteredItemsSelected) {
118
+ this.selectedProductFilter?.forEach((filter) => {
119
+ track(document, "custEv_filterAbandoned", {
120
+ click_text: filter,
121
+ click_url: filter,
122
+ element_title: "CodeSamplesGrid",
123
+ element_type: "filter abandoned",
124
+ content_category: "filter"
125
+ });
126
+ });
127
+ }
114
128
  }
115
129
 
116
130
  @api
@@ -336,6 +350,7 @@ export default class CodeSamplesGrid extends LightningElement {
336
350
  this.selectedProductFilter = newList;
337
351
  }
338
352
  this.calculatePagination();
353
+ this.filteredItemsSelected = false;
339
354
  }
340
355
 
341
356
  handleLanguageFilterChange(event: CustomEvent): void {
@@ -427,4 +442,17 @@ export default class CodeSamplesGrid extends LightningElement {
427
442
  const newurl = `${window.location.pathname}?${searchParams}`;
428
443
  window.history.pushState({ path: newurl }, "", newurl);
429
444
  }
445
+
446
+ handleReadItClick() {
447
+ this.filteredItemsSelected = true;
448
+ this.selectedProductFilter?.forEach((filter) => {
449
+ track(document, "custEv_filterApplied", {
450
+ click_text: filter,
451
+ click_url: filter,
452
+ element_title: "dx-button",
453
+ element_type: "filter applied",
454
+ content_category: "filter"
455
+ });
456
+ });
457
+ }
430
458
  }
@@ -54,6 +54,7 @@
54
54
  <dx-button
55
55
  variant="inline"
56
56
  href={item.guidesHref}
57
+ onclick={handleReadItClick}
57
58
  if:false={item.links}
58
59
  >
59
60
  Read It
@@ -5,6 +5,7 @@ import qs from "query-string";
5
5
  import uniqBy from "lodash.uniqby";
6
6
  import orderBy from "lodash.orderby";
7
7
  import { isGivenLanguageSupported } from "dxUtils/language";
8
+ import { track } from "dxUtils/analytics";
8
9
 
9
10
  const DSC_API_URL = {
10
11
  "en-us": "/docs/get_index/en-us/000.0/false/All%20Services/all",
@@ -41,6 +42,7 @@ export default abstract class DocsGrid extends LightningElement {
41
42
  private _searchTimeout?: number;
42
43
  private _couchDbDocTileExclusions?: Set<any>;
43
44
  private _allLanguages: Array<Language> = [];
45
+ private filteredItemsSelected: boolean = false;
44
46
 
45
47
  connectedCallback(): void {
46
48
  this.retrieveDscApis(true);
@@ -76,6 +78,18 @@ export default abstract class DocsGrid extends LightningElement {
76
78
  "change",
77
79
  this.handleMobileSmallView
78
80
  );
81
+
82
+ if (!this.filteredItemsSelected) {
83
+ this.selectedProductFilters?.forEach((filter) => {
84
+ track(document, "custEv_filterAbandoned", {
85
+ click_text: filter,
86
+ click_url: filter,
87
+ element_title: "CodeSamplesGrid",
88
+ element_type: "filter abandoned",
89
+ content_category: "filter"
90
+ });
91
+ });
92
+ }
79
93
  }
80
94
 
81
95
  @api apiDomain = "https://developer.salesforce.com";
@@ -403,6 +417,7 @@ export default abstract class DocsGrid extends LightningElement {
403
417
  this.selectedProductFilters = newList;
404
418
  }
405
419
  this.calculatePagination();
420
+ this.filteredItemsSelected = false;
406
421
  }
407
422
 
408
423
  handleLanguageFilterChange(event): void {
@@ -537,4 +552,17 @@ export default abstract class DocsGrid extends LightningElement {
537
552
  this.calculatePagination(urlParams.page, true);
538
553
  }
539
554
  };
555
+
556
+ handleReadItClick() {
557
+ this.filteredItemsSelected = true;
558
+ this.selectedProductFilters?.forEach((filter) => {
559
+ track(document, "custEv_filterApplied", {
560
+ click_text: filter,
561
+ click_url: filter,
562
+ element_title: "dx-button",
563
+ element_type: "filter applied",
564
+ content_category: "filter"
565
+ });
566
+ });
567
+ }
540
568
  }
@@ -159,7 +159,13 @@ export default class Form extends LightningElement {
159
159
  elementType: "button",
160
160
  ctaClick: true
161
161
  });
162
-
162
+ track(submitButtonEl, "custEv_linkClick", {
163
+ click_text: "Subscribe Now",
164
+ element_title: "button",
165
+ click_url: "/newsletter/success",
166
+ element_type: "button",
167
+ content_category: "cta"
168
+ });
163
169
  window.location.assign("/newsletter/success");
164
170
  } catch (error) {
165
171
  if (submitButtonEl) {
@@ -112,11 +112,11 @@ export default class TbidLoginMenu extends LightningElement {
112
112
  eventName: string
113
113
  ) => {
114
114
  track(target || document, eventName, {
115
- clickText: target.textContent?.trim() || "",
116
- clickUrl: target.href || "",
117
- elementTitle: "a",
118
- elementType: "link",
119
- contentCategory: "tbid"
115
+ click_text: target.textContent?.trim() || "",
116
+ click_url: target.href || "",
117
+ element_title: "a",
118
+ element_type: "link",
119
+ content_category: "tbid"
120
120
  });
121
121
  };
122
122
 
@@ -4,9 +4,9 @@ import { track } from "dxUtils/analytics";
4
4
  import { WordpressPost, NormalizedPost } from "typings/custom";
5
5
 
6
6
  const ANALYTICS_INFO = {
7
- elementType: "link",
8
- destinationType: "internal",
9
- ctaClick: true
7
+ element_type: "link",
8
+ destination_type: "internal",
9
+ cta_click: true
10
10
  };
11
11
  export abstract class PostsGrid extends LightningElement {
12
12
  @api columns = "three";
@@ -47,19 +47,19 @@ export abstract class PostsGrid extends LightningElement {
47
47
  this._morePostsViewed = true;
48
48
  track(e.target, "custEv_ctaLinkClick", {
49
49
  ...ANALYTICS_INFO,
50
- clickText: "show more",
51
- elementTitle: "dx-button",
52
- elementType: "button",
53
- contentCategory: "cta"
50
+ click_text: "show more",
51
+ element_title: "dx-button",
52
+ element_type: "button",
53
+ content_category: "cta"
54
54
  });
55
55
  } else {
56
56
  track(e.target, "custEv_ctaLinkClick", {
57
57
  ...ANALYTICS_INFO,
58
- clickText: "view archives",
59
- clickUrl: "https://developer.salesforce.com/content-archive",
60
- elementTitle: "dx-button",
61
- elementType: "button",
62
- contentCategory: "cta"
58
+ click_text: "view archives",
59
+ click_url: "https://developer.salesforce.com/content-archive",
60
+ element_title: "dx-button",
61
+ element_type: "button",
62
+ content_category: "cta"
63
63
  });
64
64
  }
65
65
  }