Skip to content

Commit

Permalink
Reconciliation Real Time Data Provider (prebid#5774)
Browse files Browse the repository at this point in the history
* FID-162: Add Reconciliation RTD Provider

* FID-162: Update Reconciliation RTD Provider API

* FID-162: Update getTargetingData method

* FID-162: Add tests
  • Loading branch information
vfedoseev authored and stsepelin committed May 28, 2021
1 parent 83e28ac commit 34427d0
Show file tree
Hide file tree
Showing 5 changed files with 699 additions and 1 deletion.
101 changes: 101 additions & 0 deletions integrationExamples/gpt/reconciliationRtdProvider_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script async src="../../build/dev/prebid.js"></script>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<meta charset="UTF-8">
<title>Reconciliation RTD Provider Example</title>
<script>
var FAILSAFE_TIMEOUT = 3300;
var PREBID_TIMEOUT = 1000;

var adUnits = [{
code: "/21834411153/rsdk-2",
mediaTypes: {
banner: {
sizes: [
[300, 250],
[728, 90],
],
},
},
// Replace this object to test a new Adapter!
bids: [{
bidder: 'appnexus',
params: {
placementId: 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.setConfig({
realTimeData: {
auctionDelay: 0,
dataProviders: [
{
name: "reconciliation",
params: {
publisherMemberId: "test_prebid_publisher",
allowAccess: true
},
},
],
},
});
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
timeout: PREBID_TIMEOUT
});
});

function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}

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

</script>

<script>
googletag.cmd.push(function () {
googletag.defineSlot('/21834411153/rsdk-2', [[300, 250], [728, 90]], 'div-gpt-ad-rsdk-1').addService(googletag.pubads());

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

<body>
<h5>Div-1</h5>
<div id='div-gpt-ad-rsdk-1'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-rsdk-1'); });
</script>
</div>
</body>
</html>
3 changes: 2 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"rtdModule": [
"browsiRtdProvider",
"audigentRtdProvider",
"jwplayerRtdProvider"
"jwplayerRtdProvider",
"reconciliationRtdProvider"
]
}
Loading

0 comments on commit 34427d0

Please sign in to comment.