Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AFP Bid Adapter: add new bid adapter and integration examples #7301

Merged
merged 33 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
25fd8b8
Fix astraoneBidAdapter
lizakobrazova Jan 26, 2021
215f6bb
Fix examples; update astraoneBidAdapter description
lizakobrazova Jan 27, 2021
15c3193
Fix astraoneBidAdapter_spec
lizakobrazova Jan 27, 2021
6a69a67
Remove integration examples
lizakobrazova Jan 27, 2021
b3f9878
Rename gbt to gpt
lizakobrazova Jan 27, 2021
573c409
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 9, 2021
a9c97e6
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 13, 2021
6e15c6a
update AFP Adapter and add page examples
andrey-ka-97 Aug 13, 2021
427aa9a
replace "AstraLab" with "AFP"
andrey-ka-97 Aug 13, 2021
b3bd86b
fix prefixes in example pages
andrey-ka-97 Aug 13, 2021
a28ee63
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 16, 2021
68d269a
Revert "update AFP Adapter and add page examples"
andrey-ka-97 Aug 16, 2021
dee3d2d
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 17, 2021
16679c1
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 19, 2021
a2d1760
fix error while testing in CircleCI
andrey-ka-97 Aug 20, 2021
5ea0e1a
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 20, 2021
1ad90c0
Merge remote-tracking branch 'origin/master' into master
andrey-ka-97 Aug 20, 2021
31224ed
update AFP Adapter and add page examples
andrey-ka-97 Aug 20, 2021
b9d9c7a
Revert "update AFP Adapter and add page examples"
andrey-ka-97 Aug 20, 2021
3c05927
fix error while testing in CircleCI
andrey-ka-97 Aug 20, 2021
11bbc58
fix error while testing in CircleCI
andrey-ka-97 Aug 20, 2021
7673e67
fix error while testing in CircleCI
andrey-ka-97 Aug 20, 2021
b944ce9
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 20, 2021
b2a69f9
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 23, 2021
48666cd
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 24, 2021
20a8496
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 30, 2021
2727a3e
Merge branch 'prebid:master' into master
andrey-ka-97 Aug 30, 2021
a554052
Merge branch 'prebid:master' into master
andrey-ka-97 Sep 3, 2021
b57bea0
replace test ids
andrey-ka-97 Sep 3, 2021
42c60ed
add new format "Just Banner" and refactoring
andrey-ka-97 Sep 17, 2021
c7f0e8a
update examples in test page and in '.md' file
andrey-ka-97 Sep 17, 2021
46f4e74
Merge branch 'prebid:master' into master
andrey-ka-97 Sep 17, 2021
784e205
Merge remote-tracking branch 'origin/master' into master
andrey-ka-97 Sep 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 242 additions & 0 deletions integrationExamples/gpt/afpExample.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Prebid.js Banner Example</title>
<script src="../../../build/dev/prebid.js"></script>
<script>
var adUnits = [
{
code: 'iib-target',
mediaTypes: {
banner: {
sizes: [[0, 0]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "In-image",
placeId: "613221112871613d1517d181", // id from personal account
placeContainer: '#iib-container',
imageUrl: "https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png",
imageWidth: 1000,
imageHeight: 524,
}
}]
},
{
code: 'iimb-target',
mediaTypes: {
banner: {
sizes: [[0, 0]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "In-image Max",
placeId: "6139ae472871613d1517dedd", // id from personal account
placeContainer: '#iimb-container',
imageUrl: "https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png",
imageWidth: 1000,
imageHeight: 524,
}
}]
},
{
code: 'icb-target',
mediaTypes: {
banner: {
sizes: [[0, 0]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "In-content Banner",
placeId: "6139ae082871613d1517dec0", // id from personal account
placeContainer: '#icb-container',
}
}]
},
{
code: 'ics-target',
mediaTypes: {
banner: {
sizes: [[0, 0]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "In-content Stories",
placeId: "6139ae292871613d1517ded3", // id from personal account
placeContainer: '#ics-container',
}
}]
},
{
code: 'as-target',
mediaTypes: {
banner: {
sizes: [[0, 0]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "Action Scroller",
placeId: "6139adc12871613d1517deb0", // id from personal account
placeContainer: '#as-container',
}
}]
},
{
code: 'asl-target',
mediaTypes: {
banner: {
sizes: [[0, 0]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "Action Scroller Light",
placeId: "6139adda2871613d1517deb8", // id from personal account
placeContainer: '#asl-container',
}
}]
},
{
code: 'jb-target',
mediaTypes: {
banner: {
sizes: [[100, 100], [300, 250], [40, 50]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "Just Banner",
placeId: "6139ae832871613d1517dee9", // id from personal account
placeContainer: '#jb-container',
}
}]
},
{
code: 'icv-target',
mediaTypes: {
video: {
playerSize: [[480, 320]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "In-content Video",
placeId: "6139ae182871613d1517deca", // id from personal account
placeContainer: '#icv-container',
}
}]
},
{
code: 'ocv-target',
mediaTypes: {
video: {
playerSize: [[480, 320]],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "Out-content Video",
placeId: "6139ae5b2871613d1517dee2", // id from personal account
placeContainer: '#ocv-container', // only the "body" tag is used as a container
}
}]
}
];

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

pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: function (e) {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;

var targets = ['iib-target', 'iimb-target', 'icb-target', 'ics-target', 'as-target', 'asl-target', 'jb-target', 'icv-target', 'ocv-target']

targets.forEach(function(target) {
var params = pbjs.getAdserverTargetingForAdUnitCode(target);
var iframe = document.getElementById(target);

if (params && params['hb_adid']) {
pbjs.renderAd(iframe.contentDocument, params['hb_adid']);
}
})
}
});
});
</script>
</head>
<body id="ocv-container">
<h2>In-image</h2>
<div class="container-wrapper">
<div id="iib-container" style="max-width: 600px;">
<img src="https://creative.astraone.io/files/default_image-1-600x400.jpg" width="100%" />
</div>
<iframe id="iib-target" style="display: none;"></iframe>
</div>

<h2>In-image Max</h2>
<div class="container-wrapper">
<div id="iimb-container" style="max-width: 600px;">
<img src="https://creative.astraone.io/files/default_image-1-600x400.jpg" width="100%" />
</div>
<iframe id="iimb-target" style="display: none;"></iframe>
</div>

<h2>In-content Banner</h2>
<div class="container-wrapper">
<div id="icb-container"></div>
<iframe id="icb-target" style="display: none;"></iframe>
</div>

<h2>In-content Stories</h2>
<div class="container-wrapper">
<div id="ics-container"></div>
<iframe id="ics-target" style="display: none;"></iframe>
</div>

<h2>Action Scroller</h2>
<div class="container-wrapper">
<div id="as-container"></div>
<iframe id="as-target" style="display: none;"></iframe>
</div>

<h2>Action Scroller Light</h2>
<div class="container-wrapper">
<div id="asl-container"></div>
<iframe id="asl-target" style="display: none;"></iframe>
</div>

<h2>Just Banner</h2>
<div class="container-wrapper">
<div id="jb-container"></div>
<iframe id="jb-target" style="display: none;"></iframe>
</div>

<h2>In-content Video</h2>
<div class="container-wrapper">
<div id="icv-container"></div>
<iframe id="icv-target" style="display: none;"></iframe>
</div>

<!-- Out-content Video -->
<iframe id="ocv-target" style="display: none;"></iframe>
</body>
</html>
152 changes: 152 additions & 0 deletions integrationExamples/gpt/afpGamExample.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Prebid.js Banner Example</title>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script src="../../../build/dev/prebid.js"></script>
<script>
var adUnits = [{
code: 'div-gpt-ad-1574864639578-0',
mediaTypes: {
banner: {
sizes: [0, 0],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "In-image",
placeId: "613221112871613d1517d181",
placeContainer: '#iib-container',
imageUrl: "https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png",
imageWidth: 600,
imageHeight: 400,
}
}]
},
{
code: 'div-gpt-ad-1574864639578-1',
mediaTypes: {
video: {
playerSize: [640, 480]
}
},
bids: [{
bidder: "afp",
params: {
placeType: "In-content Video",
placeId: "60e5684718047b3fae304617",
placeContainer: '#icv-container',
}
}]
},
{
code: 'div-gpt-ad-1574864639578-2',
mediaTypes: {
banner: {
sizes: [500, 500],
}
},
bids: [{
bidder: "afp",
params: {
placeType: "Action Scroller",
placeId: "60f15a8515770d5ab7c7f885",
placeContainer: '#as-container',
}
}]
}];

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

var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];

googletag.cmd.push(() => {
googletag.pubads().disableInitialLoad();
});

pbjs.que.push(() => {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({ bidsBackHandler: sendAdServerRequest });
});

function sendAdServerRequest() {
googletag.cmd.push(() => {
pbjs.que.push(() => {
pbjs.setTargetingForGPTAsync('div-gpt-ad-1574864639578-0');
pbjs.setTargetingForGPTAsync('div-gpt-ad-1574864639578-1');
pbjs.setTargetingForGPTAsync('div-gpt-ad-1574864639578-2');
googletag.pubads().refresh();
});
});
}

googletag.cmd.push(() => {
googletag
.defineSlot('/19968336/header-bid-tag-0', [300, 250], 'div-gpt-ad-1574864639578-0')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});

googletag.cmd.push(() => {
googletag
.defineSlot('/19968336/header-bid-tag-0', [300, 250], 'div-gpt-ad-1574864639578-1')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});

googletag.cmd.push(() => {
googletag
.defineSlot('/19968336/header-bid-tag-0', [300, 250], 'div-gpt-ad-1574864639578-2')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});

</script>
</head>
<body id="ocv-container">
<h2>In-image</h2>
<div class="container-wrapper">
<div id="iib-container" style="width: 600px;">
<img src="https://creative.astraone.io/files/default_image-1-600x400.jpg" width="100%" />
</div>
<div id="div-gpt-ad-1574864639578-0">
<script type="text/javascript">
googletag.cmd.push(function() {
googletag.display('div-gpt-ad-1574864639578-0');
});
</script>
</div>
</div>

<h2>In-content Video</h2>
<div class="container-wrapper">
<div id="icv-container"></div>
<div id="div-gpt-ad-1574864639578-1">
<script type="text/javascript">
googletag.cmd.push(function() {
googletag.display('div-gpt-ad-1574864639578-1');
});
</script>
</div>
</div>

<h2>Action Scroller</h2>
<div class="container-wrapper">
<div id="as-container"></div>
<div id="div-gpt-ad-1574864639578-2">
<script type="text/javascript">
googletag.cmd.push(function() {
googletag.display('div-gpt-ad-1574864639578-2');
});
</script>
</div>
</div>
</body>
</html>
Loading