Standalone Integration
Overview
Complete Example
<!DOCTYPE html>
<html>
<head>
<title>n360ortb Standalone Example</title>
<!-- n360ortb loader -->
<script>
!function(){if(!window.n360ortb){window.n360ortb={init:function(){e("init",arguments)},fetchBids:function(){e("fetchBids",arguments)},setDisplayBids:function(){},targetingKeys:function(){return[]},que:[]};var n=document.createElement("script");n.async=!0,n.src="https://lib.nexx360.io/nexx360ortb/api.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t)}function e(n,t){window.n360ortb.que.push([n,t])}}();
</script>
<script>
// Initialize
n360ortb.init({
currency: 'EUR'
});
// Fetch bids and render
n360ortb.fetchBids({
slots: [
{
tagId: 'your-tag-id',
slotID: 'ad-container',
sizes: [[300, 250]]
}
]
}, function(bids) {
// bids is an array of StoredBid objects
if (bids.length > 0) {
// Render each bid into its target container
bids.forEach(function(bid) {
n360ortb.renderAd(bid, bid.slotID);
});
} else {
console.log('No bids received');
}
});
</script>
</head>
<body>
<h1>My Page</h1>
<div id="ad-container" style="width: 300px; height: 250px;">
<!-- Ad will render here -->
</div>
</body>
</html>Understanding the Bid Response
The renderAd() Function
Context
Behavior
Handling Multiple Slots
Handling No Bids
How renderAd() Works
Refreshing Ads
Next Steps
Last updated
Was this helpful?