@getlupa/client 0.15.0 → 0.15.1

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.
@@ -35676,7 +35676,7 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35676
35676
  : "";
35677
35677
  }
35678
35678
  handleClick() {
35679
- var _a, _b;
35679
+ var _a, _b, _c, _d;
35680
35680
  this.trackClick({
35681
35681
  queryKey: this.options.queryKey,
35682
35682
  data: {
@@ -35686,12 +35686,13 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35686
35686
  analytics: {
35687
35687
  type: this.query ? "search_product_click" : "select_item",
35688
35688
  label: this.title || this.id || this.link,
35689
+ listLabel: (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.htmlTitleTemplate,
35689
35690
  items: [this.product],
35690
35691
  },
35691
35692
  options: { allowEmptySearchQuery: true },
35692
35693
  },
35693
35694
  });
35694
- (_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onProductClick) === null || _b === void 0 ? void 0 : _b.call(_a, {
35695
+ (_d = (_c = this.searchResultOptions.callbacks) === null || _c === void 0 ? void 0 : _c.onProductClick) === null || _d === void 0 ? void 0 : _d.call(_c, {
35695
35696
  queryKey: this.query,
35696
35697
  hasResults: true,
35697
35698
  });
@@ -36101,20 +36102,20 @@ const sendGa4AnalyticsEvent = (data, options) => {
36101
36102
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36102
36103
  const params = {
36103
36104
  search_text: data.searchQuery,
36104
- item_title: sendItemTitle ? (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label : undefined,
36105
- ecommerce: parseEcommerceData(data, title),
36105
+ item_title: title,
36106
+ ecommerce: parseEcommerceData(data, (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.listLabel),
36106
36107
  };
36107
36108
  window.dataLayer.push(Object.assign({ event: (_e = (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : options.parentEventName }, params));
36108
36109
  };
36109
36110
  const processDebugEvent = (data) => {
36110
- var _a, _b, _c;
36111
+ var _a, _b, _c, _d;
36111
36112
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
36112
36113
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36113
36114
  const params = {
36114
36115
  event: (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type,
36115
36116
  search_text: data.searchQuery,
36116
36117
  item_title: title,
36117
- ecommerce: parseEcommerceData(data, title),
36118
+ ecommerce: parseEcommerceData(data, (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.listLabel),
36118
36119
  };
36119
36120
  console.debug("Analytics debug event:", params);
36120
36121
  };
@@ -38492,6 +38493,7 @@ let SearchResults = class SearchResults extends Vue$1 {
38492
38493
  analytics: {
38493
38494
  type: "view_item_list",
38494
38495
  label: title,
38496
+ listLabel: title,
38495
38497
  items,
38496
38498
  },
38497
38499
  options: { allowEmptySearchQuery: true },
@@ -34,6 +34,7 @@ export declare type TrackableEventData = {
34
34
  analytics?: {
35
35
  type: AnalyticsEventType;
36
36
  label: string;
37
+ listLabel?: string;
37
38
  items?: Record<string, unknown>[];
38
39
  };
39
40
  options?: {
@@ -35672,7 +35672,7 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35672
35672
  : "";
35673
35673
  }
35674
35674
  handleClick() {
35675
- var _a, _b;
35675
+ var _a, _b, _c, _d;
35676
35676
  this.trackClick({
35677
35677
  queryKey: this.options.queryKey,
35678
35678
  data: {
@@ -35682,12 +35682,13 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35682
35682
  analytics: {
35683
35683
  type: this.query ? "search_product_click" : "select_item",
35684
35684
  label: this.title || this.id || this.link,
35685
+ listLabel: (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.htmlTitleTemplate,
35685
35686
  items: [this.product],
35686
35687
  },
35687
35688
  options: { allowEmptySearchQuery: true },
35688
35689
  },
35689
35690
  });
35690
- (_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onProductClick) === null || _b === void 0 ? void 0 : _b.call(_a, {
35691
+ (_d = (_c = this.searchResultOptions.callbacks) === null || _c === void 0 ? void 0 : _c.onProductClick) === null || _d === void 0 ? void 0 : _d.call(_c, {
35691
35692
  queryKey: this.query,
35692
35693
  hasResults: true,
35693
35694
  });
@@ -36097,20 +36098,20 @@ const sendGa4AnalyticsEvent = (data, options) => {
36097
36098
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36098
36099
  const params = {
36099
36100
  search_text: data.searchQuery,
36100
- item_title: sendItemTitle ? (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label : undefined,
36101
- ecommerce: parseEcommerceData(data, title),
36101
+ item_title: title,
36102
+ ecommerce: parseEcommerceData(data, (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.listLabel),
36102
36103
  };
36103
36104
  window.dataLayer.push(Object.assign({ event: (_e = (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : options.parentEventName }, params));
36104
36105
  };
36105
36106
  const processDebugEvent = (data) => {
36106
- var _a, _b, _c;
36107
+ var _a, _b, _c, _d;
36107
36108
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
36108
36109
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36109
36110
  const params = {
36110
36111
  event: (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type,
36111
36112
  search_text: data.searchQuery,
36112
36113
  item_title: title,
36113
- ecommerce: parseEcommerceData(data, title),
36114
+ ecommerce: parseEcommerceData(data, (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.listLabel),
36114
36115
  };
36115
36116
  console.debug("Analytics debug event:", params);
36116
36117
  };
@@ -38488,6 +38489,7 @@ let SearchResults = class SearchResults extends Vue$1 {
38488
38489
  analytics: {
38489
38490
  type: "view_item_list",
38490
38491
  label: title,
38492
+ listLabel: title,
38491
38493
  items,
38492
38494
  },
38493
38495
  options: { allowEmptySearchQuery: true },
@@ -34,6 +34,7 @@ export declare type TrackableEventData = {
34
34
  analytics?: {
35
35
  type: AnalyticsEventType;
36
36
  label: string;
37
+ listLabel?: string;
37
38
  items?: Record<string, unknown>[];
38
39
  };
39
40
  options?: {