-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a705559
commit 418f042
Showing
2 changed files
with
173 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
--- | ||
layout: bidder | ||
title: AFP | ||
description: Prebid AFP Bidder Adapter | ||
pbjs: true | ||
media_types: banner, video | ||
biddercode: afp | ||
safeframes_ok: false | ||
--- | ||
|
||
### Note | ||
|
||
You can use this adapter to get a bid from AFP. | ||
Please reach out to your AFP account team before using this plugin to get placeId. | ||
The code below returns a demo ad. | ||
|
||
|
||
### Bid Params | ||
|
||
{: .table .table-bordered .table-striped } | ||
| Name | Scope | Description | Example | Type | | ||
|---------------------|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------| | ||
| `placeId` | required | Place id. | '5af45ad34d506ee7acad0c26' | `string` | | ||
| `placeType` | required | Place type. | 'In-image', 'In-image Max', 'In-content Banner', 'In-content Video', 'Out-content Video', 'In-content Stories', 'Action Scroller', 'Action Scroller Light' | `string` | | ||
| `placeContainer` | required (if the frame is not safe) | The container of the place where the ad will be displayed. The css selector is specified as the value. | '#container' | `string` | | ||
| `imageUrl` | required (for 'In-image', 'In-image Max' placeType) | URL of the image on which the banner will be displayed. | 'https://creative.astraone.io/files/default_image-1-600x400.jpg' | `string` | | ||
| `imageWidth` | required (for 'In-image', 'In-image Max' placeType) | Image width. | 600 | `integer` | | ||
| `imageHeight` | required (for 'In-image', 'In-image Max' placeType) | Image height. | 400 | `integer` | | ||
|
||
|
||
### InImage Example page | ||
|
||
|
||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Prebid.js In-image Example</title> | ||
<script async src="prebid.js"></script> | ||
<script> | ||
var adUnits = [{ | ||
code: 'iib-target', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [0, 0], | ||
} | ||
}, | ||
bids: [{ | ||
bidder: "afp", | ||
params: { | ||
placeType: "In-image", | ||
placeId: "60e7039918047b3fae304850", | ||
placeContainer: '#iib-container', | ||
imageUrl: "https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png", | ||
imageWidth: 1000, | ||
imageHeight: 524, | ||
} | ||
}] | ||
}]; | ||
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 params = pbjs.getAdserverTargetingForAdUnitCode("iib-target"); | ||
var iframe = document.getElementById("iib-target"); | ||
if (params && params['hb_adid']) { | ||
pbjs.renderAd(iframe.contentDocument, params['hb_adid']); | ||
} | ||
} | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<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> | ||
<iframe id="iib-target" style="display: none;"></iframe> | ||
</div> | ||
</body> | ||
</html> | ||
``` | ||
### InImage Example page with GPT | ||
|
||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Prebid.js In-image Example</title> | ||
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script> | ||
<script async src="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: "60e7039918047b3fae304850", | ||
placeContainer: '#iib-container', | ||
imageUrl: "https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png", | ||
imageWidth: 600, | ||
imageHeight: 400, | ||
} | ||
}] | ||
}]; | ||
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'); | ||
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(); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<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> | ||
</body> | ||
</html> | ||
``` |
This file was deleted.
Oops, something went wrong.