Learn how to use the auctions API to create auctions for listings and banners.
Banner Ad Integration: 3 stages
Banner ads can be used as homepage sliders, featured brands, and carousels.
Provide a list of pages with unique identifiers for each banner slot.
Create slots for high-traffic homepages or other landing pages.
A slot includes:
!"#$%&'()*+,-._/:;<>?@[]^{}~=
SlotID | Landing Page Name | URL or Deeplinks | Width | Height | Additional Width (optional) | Additional Height (optional) |
---|---|---|---|---|---|---|
top-slot-1 | Homepage Christmas | http://example.com/home | 100 | 50 | 40 | 40 |
right-slot-2 | Homepage Christmas | http://example.com/home | 50 | 200 |
Use this sample file to bulk upload banner configurations.
Allow vendors to target specific categories and keywords. Define banner slots and share them.
Example:
SlotID | Width | Height | Alternative Width (optional) | Alternative Height (optional) |
---|---|---|---|---|
category-bottom | 100 | 50 | 40 | 40 |
Storing the resolvedBidId.
The resolvedbidId simplifies event attribution and recording for you and your vendors, similar to auctionID in sponsored listings. It needs to be stored so events can be reported later, either as a cookie or session variable for web applications, or stored as an internal variable for mobile apps.
Variable | Type | Definition | Required/optional | Notes |
---|---|---|---|---|
type | string | Type of auction | required | Must be set as “banners” |
slots | integer | Maximum number of auction winners | required | number of winners you would like the auction to return |
slotId | string | External slot ID provided by the marketplace. | required | Format: ^[\w!\"#$%&'()_+,\-._/:;<>?@\[\]^\{\}~=\\]\_$ |
categoryId | string | Marketplace’s category ID for the auction. | required only if category banners | Defaults to homepage auction if no category ID provided. |
searchQuery | string | required only if search banners *you can pass both categoryID and searchQuery in the same call | Example “blue running shoes” | |
device | string | Target device: desktop or mobile. | optional | Enum: “desktop” or “mobile.” Defaults to “desktop.” |
Variable | Type | Definition |
---|---|---|
resultType | string | ”banners” |
winners.resolvedBidId | string | A Topsort ID to be used when this item is interacted with (for reporting impressions or clicks) |
winners.type | string | Type of the winning bid. Enum: “product”, “vendor”, “brand”, “url”. |
winners.rank | integer | The product’s auction rank indicates its position, with 1 being the winner. In the auction response, the winners array is sorted, and the rank corresponds to the entry’s index. |
winners.id | string | The marketplace’s unique ID for the winning entity. |
winners.asset | array | |
winners.asset.url | string | URL source for a banner asset. The asset is served by Topsort’s CDN, contained in asset array |
Set the banner configurations inside the Topsort admin dashboard. Insert the banner in your web app’s DOM or add a component to your mobile app code.
For web apps, use the picture
element, which will let you provide multiple sources to the client browser. For example, if the asset has 2 sources:
Then you may generate the following HTML:
The client’s browser will then choose the most adequate size depending on the user’s device capabilities and only fetch the size that best fits the user’s device.
We recommend using AlamofireImage to handle download and render options. You may get your client’s device scaling factor by calling and pick the right size.
Use Glide library to render and cache images. As with iOS, you will need to check the device’s scaling factor to determine which image to download:
Learn how to use the auctions API to create auctions for listings and banners.
Banner Ad Integration: 3 stages
Banner ads can be used as homepage sliders, featured brands, and carousels.
Provide a list of pages with unique identifiers for each banner slot.
Create slots for high-traffic homepages or other landing pages.
A slot includes:
!"#$%&'()*+,-._/:;<>?@[]^{}~=
SlotID | Landing Page Name | URL or Deeplinks | Width | Height | Additional Width (optional) | Additional Height (optional) |
---|---|---|---|---|---|---|
top-slot-1 | Homepage Christmas | http://example.com/home | 100 | 50 | 40 | 40 |
right-slot-2 | Homepage Christmas | http://example.com/home | 50 | 200 |
Use this sample file to bulk upload banner configurations.
Allow vendors to target specific categories and keywords. Define banner slots and share them.
Example:
SlotID | Width | Height | Alternative Width (optional) | Alternative Height (optional) |
---|---|---|---|---|
category-bottom | 100 | 50 | 40 | 40 |
Storing the resolvedBidId.
The resolvedbidId simplifies event attribution and recording for you and your vendors, similar to auctionID in sponsored listings. It needs to be stored so events can be reported later, either as a cookie or session variable for web applications, or stored as an internal variable for mobile apps.
Variable | Type | Definition | Required/optional | Notes |
---|---|---|---|---|
type | string | Type of auction | required | Must be set as “banners” |
slots | integer | Maximum number of auction winners | required | number of winners you would like the auction to return |
slotId | string | External slot ID provided by the marketplace. | required | Format: ^[\w!\"#$%&'()_+,\-._/:;<>?@\[\]^\{\}~=\\]\_$ |
categoryId | string | Marketplace’s category ID for the auction. | required only if category banners | Defaults to homepage auction if no category ID provided. |
searchQuery | string | required only if search banners *you can pass both categoryID and searchQuery in the same call | Example “blue running shoes” | |
device | string | Target device: desktop or mobile. | optional | Enum: “desktop” or “mobile.” Defaults to “desktop.” |
Variable | Type | Definition |
---|---|---|
resultType | string | ”banners” |
winners.resolvedBidId | string | A Topsort ID to be used when this item is interacted with (for reporting impressions or clicks) |
winners.type | string | Type of the winning bid. Enum: “product”, “vendor”, “brand”, “url”. |
winners.rank | integer | The product’s auction rank indicates its position, with 1 being the winner. In the auction response, the winners array is sorted, and the rank corresponds to the entry’s index. |
winners.id | string | The marketplace’s unique ID for the winning entity. |
winners.asset | array | |
winners.asset.url | string | URL source for a banner asset. The asset is served by Topsort’s CDN, contained in asset array |
Set the banner configurations inside the Topsort admin dashboard. Insert the banner in your web app’s DOM or add a component to your mobile app code.
For web apps, use the picture
element, which will let you provide multiple sources to the client browser. For example, if the asset has 2 sources:
Then you may generate the following HTML:
The client’s browser will then choose the most adequate size depending on the user’s device capabilities and only fetch the size that best fits the user’s device.
We recommend using AlamofireImage to handle download and render options. You may get your client’s device scaling factor by calling and pick the right size.
Use Glide library to render and cache images. As with iOS, you will need to check the device’s scaling factor to determine which image to download: