Skip to content

Commit 9952cef

Browse files
stanlp1stanlp1
andauthored
[CI-4464] Add item ids to select tracking (#224)
* update to add item ids to select tracking * remove any --------- Co-authored-by: stanlp1 <stanley.peng@constructor.io>
1 parent 5b440e0 commit 9952cef

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"whatwg-fetch": "^3.6.20"
113113
},
114114
"peerDependencies": {
115-
"@constructor-io/constructorio-client-javascript": "^2.51.0",
115+
"@constructor-io/constructorio-client-javascript": "^2.64.0",
116116
"downshift": "^7.2.1",
117117
"react": ">=16.12.0",
118118
"react-dom": ">=16.12.0",

src/hooks/useDownShift.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ const useDownShift: UseDownShift = ({
5757
// (ie: Search Suggestions, Products, Custom Cio sections, etc)
5858
// This does not apply to custom user defined sections that aren't part of Constructor index
5959
} else if (selectedItem.result_id) {
60-
trackAutocompleteSelect(cioClient, selectedItem.value, {
60+
const selectData = {
6161
originalQuery: previousQuery,
6262
section: selectedItem.section,
63-
});
63+
itemId: selectedItem.data?.id,
64+
};
65+
66+
trackAutocompleteSelect(cioClient, selectedItem.value, selectData);
6467
}
6568
} catch (error) {
6669
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)