Description
A products listing page shows a list items. For example, it can be a category page, or a search results page.
Before inserting this snippet, please make sure you have correctly set up the loader.
The viewList event
Items can be provided in two ways:
- by id only: if you have previous imported your products data feed into Transactionale
- a full object with all the required details
If you provide the products by ID only, make sure you use the same ID as contained in the datafeed you provided.
_trx.push({
event: 'viewList',
itemIDs: ['ABC123', 'ABC124']
});
// Example of full product specification
_trx.push({
event: 'viewList',
items: [{
id: 'ABC123',
price: '12.34',
name: 'Product name',
categoryId: 123, // Google merchant center category ID
categoryName: 'My Category', // Custom or Google category name
barcode: '0000123456789'
}]
});
Available Google Merchant categories: