Skip to content

Commit

Permalink
Fix searchUnitId for click event on custom PLP
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 committed Jul 10, 2024
1 parent e2d222b commit 0cdaa2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/product-list-page-custom/ProductList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '../../scripts/commerce.js';

const html = htm.bind(h);
const searchUnitId = 'livesearch-plp';

class ProductCard extends Component {
constructor(props) {
Expand Down Expand Up @@ -49,7 +50,7 @@ class ProductCard extends Component {
onProductClick(product) {
window.adobeDataLayer.push((dl) => {
// TODO: Remove eventInfo once collector is updated
dl.push({ event: 'search-product-click', eventInfo: { ...dl.getState(), searchUnitId: 'searchUnitId', sku: product.sku } });
dl.push({ event: 'search-product-click', eventInfo: { ...dl.getState(), searchUnitId, sku: product.sku } });
});
}

Expand Down

0 comments on commit 0cdaa2b

Please sign in to comment.