Skip to content

Commit

Permalink
Publir Bid Adapter : initial release (#10851)
Browse files Browse the repository at this point in the history
* New bidder adapter: Publir

* Added hello world for test

* Verified test cases

* Changes made as per the feedback.

* updated code as per the feedback.

* Updated impression url.

* Update Impression call

* Added more test cases for increasing Coverage

* updated test cases

* Added condition as per the feedback

* updated fix

* Added conditions
  • Loading branch information
mdghousesaqlain authored Mar 12, 2024
1 parent 0756379 commit 404caa4
Show file tree
Hide file tree
Showing 4 changed files with 1,010 additions and 0 deletions.
84 changes: 84 additions & 0 deletions integrationExamples/gpt/publir_hello_world.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Prebid.js Banner gpt Example</title>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script async src="../../build/dev/prebid.js"></script>
<script>
var FAILSAFE_TIMEOUT = 3300;
var PREBID_TIMEOUT = 1000;

var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
mediaTypes: {
banner: {
sizes: [[160, 600]],
}
},
bids: [{
bidder: 'publir',
params: {
pubId: 13144370
}
}]

}];

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

</script>

<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag.pubads().disableInitialLoad();
});

pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);

pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
timeout: PREBID_TIMEOUT
});
});

function sendAdserverRequest() {
googletag.cmd.push(function () {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync('div-gpt-ad-1460505748561-0');
googletag.pubads().refresh();
});
});
}

setTimeout(function () {
sendAdserverRequest();
}, FAILSAFE_TIMEOUT);

</script>

<script>
googletag.cmd.push(function () {
googletag.defineSlot('/1011927,22444378655/hre_vcn_4', [[160, 600], [240, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());

googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
<h2>Prebid.js Test</h2>
<h5>Div-1</h5>
<div id='div-gpt-ad-1460505748561-0'>
<script type='text/javascript'>
googletag.cmd.push(function () { googletag.display('div-gpt-ad-1460505748561-0'); });
</script>
</div>
</body>

</html>
Loading

0 comments on commit 404caa4

Please sign in to comment.