Skip to content

Commit 3ed6a36

Browse files
authored
fix: coveo anatylytics fixed collect item event (#111)
1 parent b31c01f commit 3ed6a36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/coveo-starter/components/ResultItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ const ResultItem: FC<ResultItemProps> = ({
6464
coveoua('send', 'pageview');
6565
coveoua('ec:addProduct', {
6666
'id': '${item.raw.permanentid}',
67-
'name': '${item.raw.ec_name}',
68-
'category': '${(item.raw.ec_category as string[])?.[0]}',
69-
'price': '${item.raw.price}',
67+
'name': '${item.raw.ec_name || item.title}',
68+
'category': '${(item.raw.ec_category as string[])?.[0] || item.raw.collection}',
69+
'price': '${item.raw.price || 0}',
7070
});
7171
7272
coveoua('ec:setAction', 'detail');

0 commit comments

Comments
 (0)