Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrobert committed Nov 9, 2022
2 parents 66aed0f + fe23164 commit f71cd8b
Show file tree
Hide file tree
Showing 315 changed files with 40,630 additions and 11,717 deletions.
143 changes: 143 additions & 0 deletions integrationExamples/gpt/mgidRtdProvider_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<!DOCTYPE html>
<html>
<head>
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<script>
window.googletag = window.googletag || { cmd: [] };
googletag.cmd.push(function () {
googletag.defineSlot('/46380388/herbeauty_prebid', [[320, 100], [950, 90], [1024, 768], [120, 600], [300, 75], [970, 66], [300, 50], [300, 31], [320, 480], [750, 200], 'fluid', [250, 250], [250, 360], [120, 90], [1, 1], [292, 30], [300, 100], [768, 1024], [88, 31], [200, 200], [300, 600], [300, 1050], [960, 90], [125, 125], [180, 150], [970, 250], [168, 28], [980, 120], [120, 20], [120, 240], [480, 320], [468, 60], [120, 30], [120, 60], [750, 300], [930, 180], [728, 90], [168, 42], [980, 90], [320, 50], [750, 100], [200, 446], [336, 280], [300, 250], [580, 400], [970, 90], [160, 600]], 'div-gpt-ad-1660208650016-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
<link rel="icon" type="image/png" href="/favicon.png">
<script src="../../build/dev/prebid.js" async></script>
<script>
var sizes = [
[300, 250]
];
var PREBID_TIMEOUT = 1000;
var FAILSAFE_TIMEOUT = 3000;
var adUnits = [{
code: '/46380388/herbeauty_prebid',
mediaTypes: {
banner: {
sizes: [[320, 100], [950, 90], [1024, 768], [120, 600], [300, 75], [970, 66], [300, 50], [300, 31], [320, 480], [750, 200], [250, 250], [250, 360], [120, 90], [1, 1], [292, 30], [300, 100], [768, 1024], [88, 31], [200, 200], [300, 600], [300, 1050], [960, 90], [125, 125], [180, 150], [970, 250], [168, 28], [980, 120], [120, 20], [120, 240], [480, 320], [468, 60], [120, 30], [120, 60], [750, 300], [930, 180], [728, 90], [168, 42], [980, 90], [320, 50], [750, 100], [200, 446], [336, 280], [300, 250], [580, 400], [970, 90], [160, 600]]
}
},
bids: [{
bidder: 'mgid',
params: {
accountId: '219'
}
}]
}];
// ======== DO NOT EDIT BELOW THIS LINE =========== //
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag.pubads().disableInitialLoad();
});
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function () {
pbjs.setConfig({ priceGranularity: 'high' })
pbjs.setConfig({
debug: true,
realTimeData: {
auctionDelay: 1000,
dataProviders: [{
name: 'mgid',
waitForIt: true,
params: {
clientSiteId: 1
}
}]
},
/*consentManagement: {
gdpr: {
cmpApi: 'iab',
timeout: 8000,
defaultGdprScope: true
}
}*/
// static data for consent management is only for test purpose - with this data we didn't get ads at the auction
/*consentManagement: {
usp: {
cmpApi: 'static',
consentData: {
getUSPData: {
uspString: '1YNY',
}
}
},
gdpr: {
cmpApi: 'static',
consentData: {
getTCData: {
tcString: 'COwK6gaOwK6gaFmAAAENAPCAAAAAAAAAAAAAAAAAAAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
gdprApplies: true,
purpose: {
consents: {
1: true,
2: true,
},
},
vendor: {
consents: {
358: true,
},
}
}
}
}
}*/
});
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver,
timeout: PREBID_TIMEOUT,
ortb2: {
site: {
content: {
language: 'en',
}
}
}
});
});

function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function () {
pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
}

// in case PBJS doesn't load
setTimeout(function () {
initAdserver();
}, FAILSAFE_TIMEOUT);

</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>

<h2>Basic Prebid.js Example</h2>
<h5>Div-1</h5>

<div id='div-gpt-ad-1660208650016-0' style='min-width: 88px; min-height: 20px;'>
<script>
googletag.cmd.push(function () {
googletag.display('div-gpt-ad-1660208650016-0');
});
</script>
</div>

</body>
</html>
61 changes: 10 additions & 51 deletions integrationExamples/gpt/weboramaRtdProvider_example.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>weborama rtd submodule example</title>
</head>

<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>weborama rtd submodule example</title>
</head>
<body>

<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
Expand All @@ -33,16 +30,19 @@
weboCtxConf: {
token: "to-be-defined", // mandatory
targetURL: "https://prebid.org", // default is document.URL
assetID: "token:identifier", // new parameter, overrides url
setPrebidTargeting: true, // override param.setPrebidTargeting or default true
sendToBidders: true, // override param.sendToBidders or default true
defaultProfile: { // optional
webo_ctx: ["Rugby_Renault_c11495", "Sport_c11893"],
webo_ds: ['bar']
},
baseURLProfileAPI: 'ctx-preprod.weborama.com',
// enabled: false,
//, onData: function (data,...) { ...}
},
weboUserDataConf: {
enabled: false,
accountId: 12345, // recommended
setPrebidTargeting: true, // override param.setPrebidTargeting or default true
sendToBidders: ['smartadserver'], // specify the bidder to share data
Expand All @@ -55,7 +55,7 @@
//, onData: function (data,...) { ...}
},
sfbxLiteDataConf: {
enabled: true,
enabled: false,
defaultProfile: { // optional
lite_occupation: ['gérant', 'bénévole'],
lite_hobbies: ['sport', 'cinéma'],
Expand Down Expand Up @@ -118,46 +118,6 @@
networkId: 456456,
},
}]
},
{
code: '/1056029/webo-wam-prebid',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'smartadserver',
params: {
siteId: 1234,
pageId: 1234,
formatId: 1234,
}
}, {
bidder: 'pubmatic',
params: {
publisherId: '32572',
}
}, {
bidder: 'appnexus',
params: {
placementId: 234234,
}
}, {
bidder: 'rubicon',
params: {
accountId: '14062',
siteId: '70608',
zoneId: '335918',
userId: '12346',
}
}, {
bidder: 'criteo',
params: {
zoneId: 234234,
networkId: 456456,
},
}]
}
];

Expand Down Expand Up @@ -197,7 +157,6 @@

googletag.cmd.push(function () {
googletag.defineSlot('/1056029/webo-ctx-prebid', div_1_sizes, 'div-gpt-ad-1620653642627-0').addService(googletag.pubads());
googletag.defineSlot('/1056029/webo-wam-prebid', div_2_sizes, 'div-gpt-ad-1645023761875-0').addService(googletag.pubads());
googletag.pubads().disableInitialLoad();
googletag.enableServices();
});
Expand Down
98 changes: 98 additions & 0 deletions integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<html>

<head>
<script src="https://cdn.jwplayer.com/libraries/l5MchIxB.js"></script>
<script async src="../../../build/dev/prebid.js"></script>

<title>JW Player with Bid Marked As Used</title>

<!--This demo listens to the Video events that are fired when an ad impression or ad error came from a bid. -->

<script>
// Setup ad units
var adUnits = [{
code: 'div-gpt-ad-51545-0',
mediaTypes: {
video: {}
},
video: {
divId: 'player', // required to indicate which player is being used to render this ad unit.
},

bids: [{
bidder: 'ix',
params: {
siteId: '300',
}
}]
}];

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

pbjs.que.push(function () {
pbjs.setConfig({
video: {
providers: [{
divId: 'player',
vendorCode: 1, // jwplayer vendorCode
playerConfig: {
licenseKey: 'IAjLREYRLylTWsfLN3FoN/O3iQLbs+AfgZLlkAoyH8gSf7TnNtmOLcR8CUY=',
params: {
vendorConfig: {
file: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/SubaruOutbackOnStreetAndDirt.mp4',
advertising: { client: 'vast' }
}
}
},
},]
},
debugging: {
enabled: true,
intercept: [
{
when: {
adUnitCode: 'div-gpt-ad-51545-0',
},
then: {
cpm: 25,
mediaType: "video",
vastUrl: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",
// vastXml: "<VAST version=\"3.0\"> <Ad id=\"123\"> <InLine> <AdSystem>PubMatic</AdSystem> <AdTitle>VAST 2.0 Instream Test</AdTitle> <Description>VAST 2.0 Instream Test</Description> <Error> <![CDATA[https://aktrack.pubmatic.com/er=[ERRORCODE]]]> </Error> <Impression> <![CDATA[https://aktrack.pubmatic.com?e=impression]]> </Impression> <Creatives> <Creative AdID=\"123\"> <Linear> <Duration>00:00:30</Duration> <TrackingEvents> <Tracking event=\"creativeView\"> <![CDATA[https://aktrack.pubmatic.com?e=creativeView]]> </Tracking> <Tracking event=\"start\"> <![CDATA[https://aktrack.pubmatic.com?e=start]]> </Tracking> <Tracking event=\"midpoint\"> <![CDATA[https://aktrack.pubmatic.com?e=midpoint]]> </Tracking> <Tracking event=\"firstQuartile\"> <![CDATA[https://aktrack.pubmatic.com?e=firstQuartile]]> </Tracking> <Tracking event=\"thirdQuartile\"> <![CDATA[https://aktrack.pubmatic.com?e=thirdQuartile]]> </Tracking> <Tracking event=\"complete\"> <![CDATA[https://aktrack.pubmatic.com?e=complete]]> </Tracking> </TrackingEvents> <VideoClicks> <ClickThrough> <![CDATA[https://www.pubmatic.com]]> </ClickThrough> </VideoClicks> <MediaFiles> <MediaFile delivery=\"progressive\" type=\"video/mp4\" bitrate=\"500\" width=\"480\" height=\"460\" scalable=\"true\" maintainAspectRatio=\"true\"> <![CDATA[https://staging.pubmatic.com:8443/test/spinning-logo-480x360_video.mp4]]> </MediaFile> <MediaFile delivery=\"progressive\" type=\"video/ogg\" bitrate=\"500\" width=\"480\" height=\"460\" scalable=\"true\" maintainAspectRatio=\"true\"> <![CDATA[https://staging.pubmatic.com:8443/test/spinning-logo-480x360_video.ogg]]> </MediaFile> <MediaFile delivery=\"progressive\" type=\"video/x-flv\" bitrate=\"500\" width=\"400\" height=\"300\" scalable=\"true\" maintainAspectRatio=\"true\"> <![CDATA[https://staging.pubmatic.com:8443/test/PubMatic_test_video.flv]]> </MediaFile> </MediaFiles> </Linear> </Creative> <Creative AdID=\"123\"> <NonLinearAds> <TrackingEvents></TrackingEvents> <NonLinear height=\"50\" width=\"300\" minSuggestedDuration=\"00:00:05\"> <StaticResource creativeType=\"image/jpeg\"> <![CDATA[https://staging.pubmatic.com:8443/test/PubMatic_LetsBeClear_300x50.jpeg]]> </StaticResource> <NonLinearClickThrough> <![CDATA[https://www.pubmatic.com]]> </NonLinearClickThrough> </NonLinear> </NonLinearAds> </Creative> <Creative AdID=\"123\"> <CompanionAds> <Companion width=\"300\" height=\"250\"> <StaticResource creativeType=\"image/jpeg\"> <![CDATA[https://staging.pubmatic.com:8443/test/PubMatic_LetsBeClear_320x250.jpg]]> </StaticResource> <CompanionClickThrough> <![CDATA[https://www.pubmatic.com]]> </CompanionClickThrough> </Companion> </CompanionAds> </Creative> </Creatives> </InLine> </Ad> </VAST>",
ad: "<VAST version=\"3.0\"> <Ad id=\"123\"> <InLine> <AdSystem>PubMatic</AdSystem> <AdTitle>VAST 2.0 Instream Test</AdTitle> <Description>VAST 2.0 Instream Test</Description> <Error> <![CDATA[https://aktrack.pubmatic.com/er=[ERRORCODE]]]> </Error> <Impression> <![CDATA[https://aktrack.pubmatic.com?e=impression]]> </Impression> <Creatives> <Creative AdID=\"123\"> <Linear> <Duration>00:00:30</Duration> <TrackingEvents> <Tracking event=\"creativeView\"> <![CDATA[https://aktrack.pubmatic.com?e=creativeView]]> </Tracking> <Tracking event=\"start\"> <![CDATA[https://aktrack.pubmatic.com?e=start]]> </Tracking> <Tracking event=\"midpoint\"> <![CDATA[https://aktrack.pubmatic.com?e=midpoint]]> </Tracking> <Tracking event=\"firstQuartile\"> <![CDATA[https://aktrack.pubmatic.com?e=firstQuartile]]> </Tracking> <Tracking event=\"thirdQuartile\"> <![CDATA[https://aktrack.pubmatic.com?e=thirdQuartile]]> </Tracking> <Tracking event=\"complete\"> <![CDATA[https://aktrack.pubmatic.com?e=complete]]> </Tracking> </TrackingEvents> <VideoClicks> <ClickThrough> <![CDATA[https://www.pubmatic.com]]> </ClickThrough> </VideoClicks> <MediaFiles> <MediaFile delivery=\"progressive\" type=\"video/mp4\" bitrate=\"500\" width=\"480\" height=\"460\" scalable=\"true\" maintainAspectRatio=\"true\"> <![CDATA[https://staging.pubmatic.com:8443/test/spinning-logo-480x360_video.mp4]]> </MediaFile> <MediaFile delivery=\"progressive\" type=\"video/ogg\" bitrate=\"500\" width=\"480\" height=\"460\" scalable=\"true\" maintainAspectRatio=\"true\"> <![CDATA[https://staging.pubmatic.com:8443/test/spinning-logo-480x360_video.ogg]]> </MediaFile> <MediaFile delivery=\"progressive\" type=\"video/x-flv\" bitrate=\"500\" width=\"400\" height=\"300\" scalable=\"true\" maintainAspectRatio=\"true\"> <![CDATA[https://staging.pubmatic.com:8443/test/PubMatic_test_video.flv]]> </MediaFile> </MediaFiles> </Linear> </Creative> <Creative AdID=\"123\"> <NonLinearAds> <TrackingEvents></TrackingEvents> <NonLinear height=\"50\" width=\"300\" minSuggestedDuration=\"00:00:05\"> <StaticResource creativeType=\"image/jpeg\"> <![CDATA[https://staging.pubmatic.com:8443/test/PubMatic_LetsBeClear_300x50.jpeg]]> </StaticResource> <NonLinearClickThrough> <![CDATA[https://www.pubmatic.com]]> </NonLinearClickThrough> </NonLinear> </NonLinearAds> </Creative> <Creative AdID=\"123\"> <CompanionAds> <Companion width=\"300\" height=\"250\"> <StaticResource creativeType=\"image/jpeg\"> <![CDATA[https://staging.pubmatic.com:8443/test/PubMatic_LetsBeClear_320x250.jpg]]> </StaticResource> <CompanionClickThrough> <![CDATA[https://www.pubmatic.com]]> </CompanionClickThrough> </Companion> </CompanionAds> </Creative> </Creatives> </InLine> </Ad> </VAST>"
}
},
]
}
});

pbjs.addAdUnits(adUnits);

pbjs.onEvent('videoSetupComplete', (e) => {
console.log('player setup complete: ', e);
});

pbjs.onEvent('videoSetupFailed', e => {
console.log('player setup failed: ', e);
});

pbjs.onEvent('videoPlaybackRequest', (e) => {
pbjs.requestBids(adUnits);
});

pbjs.onEvent('videoBidError', e => {
console.log('An Ad Error came from a Bid: ', e);
});

pbjs.onEvent('videoBidImpression', e => {
console.log('An Ad Impression came from a Bid: ', e);
});
});
</script>
</head>

<body>
<div id ="player"></div>
</body>

</html>
Loading

0 comments on commit f71cd8b

Please sign in to comment.