Fallback and A/B Testing
If the retailer already is running ads using an ad server, it is possible to run it alongside Topsort using a fallback logic. This allows retailers to compare ad servers performance and increase fill-rates.
For instance, if the retailer is running banners ads using GAM, they can set Topsort as the primary ad server to make sure their direct sold campaigns have priority over GAM’s demand. Ad requests and interactions coming from ads not served by Topsort can be reported to Topsort to see and compare metrics in one place.
For running a Fallback logic, the retailer needs to integrate to Topsort using any of the previously mentioned methods and request an ad from the secondary ad server only in cases where no winners are returned.
This approach also applies for A/B testing changing the selection logic by using audiences or traffic split.
async function displayAd() { try { const response = await fetch('https://api.topsort.com/v2/auctions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({}) }); const auctionData = await response.json();
if (auctionData?.results?.winners) { console.log('Topsort ad displayed.'); return; // Exit the function early since we displayed an ad } else { console.log('No Topsort ad available.'); } } catch (error) { console.error('Error fetching Topsort ad:', error); }
if (secondaryNetwork) { // Render ad from secondary network console.log('Displaying secondary ad.'); } else { console.warn('No secondary ad network configured.'); }}
displayAd();