Implement badges
Before you beginContact your Customer Success Manager to have badges enabled for your company.
How Constructor returns badges
Constructor includes badge assignments in the API response for the following surfaces:
- Search and browse: Badge data is returned in the API response for a search results page, browse category page, or collection page (PLP).
- Product detail page (PDP): Badge data is returned in the product details response for a specific product detail page.
- Recommendations pod: Badge data is returned in the API response for a specific recommendations pod.
Badge information appears in the labels field within each item in a results array. If Constructor does not assign any badges to an item, then the labels field will be empty.
"results": [
{
"labels": {
"__cnstrc_is_context_bestseller": { "display_name": "is_context_bestseller", "value": null },
"__cnstrc_is_global_bestseller": { "display_name": "is_global_bestseller", "value": null },
"__cnstrc_times_was_bought_last_week": { "display_name": "times_was_bought_last_week", "value": "63" }
}
}
]Render badges on your storefront
Your team is responsible for parsing the labels field and deciding how badges appear in your storefront. This includes:
Design: What the badges look like (e.g., style, color, shape, etc.)
Display rules: How many badges to show per item, and in what order.
Preview badges in the Constructor dashboardYou can use Interact to preview returned badges for specific search results pages, browse category pages, and collections. Learn more about previewing badges in Interact.
Updated 29 days ago