Skip to content

Product listing tutorial

View MD

Product listing integration follows the same principles as the search integration. Follow the search tutorial for more details.

This tutorial only highlights the couple of deviations from search.

Product listing

Before you begin the implementation, ensure that a valid pairing between products and categories exists. See the Pairing docs for more details.

Product listing

GET https://live.luigisbox.com/search
?f[]=type:item
&f[]=category_id:<category_id>
&plp=category_id
&facets=price_amount,category

Fire a dataLayer event for product listing

Section titled “Fire a dataLayer event for product listing”

After the results have been rendered, fire a Product listing dataLayer event describing what you have just rendered.

Product listing

dataLayer.push({
event: "view_item_list",
ecommerce: {
item_list_name: "Product Listing",
items: [
{
item_id: "PR-49738",
item_name: "Fender Newporter Player",
index: 0,
price: 289
},
{
item_id: "PR-103416",
item_name: "Fender Malibu Classic Aged Cognac Burst",
index: 1,
price: 619
}
],
scopes: {
"CategoryLabel": "Musicians | Guitars | Electro-Acoustic Guitars",
"CategoryIdentity": "882827"
},
filters: {}
}
});

dataLayer event shortened for brevity.

When the user clicks on a result, immediately fire a dataLayer event.

PLP click

dataLayer.push({
event: "select_item",
ecommerce: {
items: [
{
item_id: "PR-49738",
}
]
}
});