filter field narrows an auction to ads whose products attributes match specific key:value pairs — a brand, a color, a material, a size, or any other attribute available at your marketplace. The attributes must be present on the marketplace catalog.
Use it when your page already knows something about what the shopper is looking at that your triggers can’t express. A shoe search page with a “Nike only” facet applied, for example, shouldn’t return sponsored listings for Adidas.
Attribute filtering requires additional integration and configuration. Your marketplace needs filterable attributes configured before the
filter field has any effect — contact your Topsort representative to enable it.How filtering differs from triggers
Triggers and filters do different jobs, and both apply to the same auction:- Triggers (
products.ids,category,searchQuery) select which bids are eligible to enter the auction. filterthen narrows that eligible set by dropping ads whose attributes don’t match.
The filter object
Choosing an operator
- Use
andto be stricter.["brand:nike", "color:black"]withandkeeps only ads for products that are both Nike and black. - Use
orto be broader. The same attributes withorkeep ads for any Nike product or any black product.
A narrower filter means fewer participating bids, which means a higher chance of an auction returning no winners. If you see empty
winners arrays after adding a filter, try or before assuming something is misconfigured.Matching rules
- Attributes are matched as exact strings.
brand:nikedoes not matchbrand:Nike, and does not matchbrand:nike-air. There is no wildcard, prefix, or case-insensitive matching. - The
operatorvalue itself is case-insensitive, so"AND"and"and"both work. We recommend lowercase for consistency with the rest of the API.
Limits and errors
Omit the
filter field entirely if you don’t want to filter. There is no “match everything” value.
Examples
Filtering a set of products
Narrow a set of products auction to black Nike shoes:Filtering a category page
Narrow a category auction to two brands:or, an ad qualifies if it’s a Targus bag or a Samsonite bag. Bags from other brands don’t participate.
Filtering search results
Narrow a search auction to a single material:and and or behave identically. We use and here to signal that adding another attribute will make the filter stricter.
Sponsored brands
The Sponsored Brands endpoint supports the samefilter object, with one difference: it sits alongside triggers rather than alongside the targeting fields.