clients
Banners: Low-Code Integration
You can easily integrate banners into your site/app with the our open source library banners.js.
Remember to replace the token
(your API key) and the slot-id
attribute with your own values that you can find at Topsort.
Usage
Banner Attributes
Name | Type | Description |
---|---|---|
width | Number | Banner width |
height | Number | Banner height |
slot-id | String | The slot ID for this banner |
category-id | Optional String | The category ID of the current page |
search-query | Optional String | The search query of the current page |
Banner Behaviors
Function Name | Arg type | Return Type | Description |
---|---|---|---|
getLink | Banner | string | Generates a URL from a banner response |
getLoadingElement | HTMLElement | A custom element to be shown when the banner is loading. | |
getErrorElement | HTMLElement | A custom element to be shown when the banner errors. |
Banner Interface
Name | Type | Description |
---|---|---|
type | "product" | "vendor" | "brand" | "url" | The type of the winning entity, represented by the banner. |
id | string | The ID of the winning entity. If the entity is of type URL, this is the URL. |
resolvedBidId | string | The corresponding auction ID of the winning entity. |
asset | [{ url: string }] | An array of url linking to the assets of the banne |