Skip to content

Commit

Permalink
Merge pull request #5 from prebid/master
Browse files Browse the repository at this point in the history
rebase
  • Loading branch information
patmmccann authored Apr 19, 2021
2 parents 3501414 + dc710b1 commit 7f186df
Show file tree
Hide file tree
Showing 114 changed files with 7,394 additions and 1,064 deletions.
26 changes: 13 additions & 13 deletions integrationExamples/gpt/gdpr_hello_world.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,37 @@
<script>
var PREBID_TIMEOUT = 700;
var FAILSAFE_TIMEOUT = 2500;

var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
mediaTypes: {
banner: {
sizes: [[300, 250], [300,600]]
}
},

// 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.addAdUnits(adUnits);
pbjs.setConfig({
Expand All @@ -130,7 +130,7 @@
timeout: PREBID_TIMEOUT
});
});

function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
Expand All @@ -141,23 +141,23 @@
});
});
}

setTimeout(function() {
sendAdserverRequest();
console.log('timeout in main pbjs fired');
}, FAILSAFE_TIMEOUT);
</script>

</script>
<script>
googletag.cmd.push(function () {
googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 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>
Expand Down
30 changes: 3 additions & 27 deletions integrationExamples/gpt/haloRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,6 @@
googletag.pubads().disableInitialLoad();
});

var appnexusSegmentHandler = function(bid, segments) {
if (!bid.params) {
bid.params = {};
}
if (!bid.params.user) {
bid.params.user = {};
}

if (!Array.isArray(bid.params.user.segments)) {
bid.params.user.segments = [];
}

var appnexusSegments = [];
for (var i = 0; i < segments.length; i++) {
var segment = segments[i];
let appnexusSegment = {'id': segment.id, 'value': segment.value};
appnexusSegments.push(appnexusSegment);
}
bid.params.user.segments = bid.params.user.segments.concat(appnexusSegments);
};

pbjs.que.push(function() {
pbjs.setConfig({
debug: true,
Expand All @@ -71,9 +50,6 @@
name: "halo",
waitForIt: true,
params: {
mapSegments: {
appnexus: appnexusSegmentHandler // pass true to use the builtin handler. here, we will demo overriding the handler with a function
},
segmentCache: false,
requestParams: {
publisherId: 0
Expand All @@ -89,7 +65,7 @@
});

function sendAdserverRequest() {
document.getElementById('audigent_segments').innerHTML = JSON.stringify(adUnits[0].bids[0].params.user.segments);
document.getElementById('audigent_segments').innerHTML = window.localStorage.getItem('auHaloRtd');
document.getElementById('halo_id').innerHTML = testHaloId;

if (pbjs.adserverRequestSent) return;
Expand Down Expand Up @@ -130,7 +106,7 @@
</head>

<body>
<h2>Audigent Segments Prebid</h2>
<h2>Halo RTD Prebid</h2>

<div id='test-div'>
<script>
Expand All @@ -142,7 +118,7 @@ <h2>Audigent Segments Prebid</h2>
<div id='halo_id'>
</div>

Audigent Segments (Appnexus):
Halo Real-Time Data:
<div id='audigent_segments'>
</div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions integrationExamples/gpt/idImportLibrary_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
}, {
name: 'identityLink',
params: {
pid: '14' // Set your real identityLink placement ID here
},
pid: '14', // Set your real identityLink placement ID here
// notUse3P: true // true/false - If you do not want to use 3P endpoint to retrieve envelope. If you do not set this property to true, 3p endpoint will be fired. By default this propertt is undefined and 3p request will be fired.},
storage: {
type: 'html5',
name: 'idl_env',
Expand Down
146 changes: 146 additions & 0 deletions integrationExamples/gpt/sirdataRtdProvider_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://cache.consentframework.com/js/pa/1020/c/Y1Dhs/stub" charset="utf-8"></script>
<script type="text/javascript" async src="https://choices.consentframework.com/js/pa/1020/c/Y1Dhs/cmp" charset="utf-8"></script>
</head>
<body>

<script async src="https://pagead2.googlesyndication.com/tag/js/gpt.js"></script>
<script src="../../build/dev/prebid.js" async></script>

<script>
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function() {
pbjs.setConfig({
debug: true,
realTimeData: {
auctionDelay: 1000,
dataProviders: [
{
name: "SirdataRTDModule",
waitForIt: true,
params: {
setGptKeyValues: true,
partnerId: 1,
key: 1,
}
}
]
},
consentManagement: {
usp: {
cmpApi: 'iab',
timeout: 100 // US Privacy timeout 100ms
},
gdpr: {
cmpApi: 'iab',
timeout: 8000,
defaultGdprScope: true,
rules: [{
purpose: "storage",
enforcePurpose: true,
enforceVendor: true,
vendorExceptions: ["appnexus"] //Can work without consent for cookies
},{
purpose: "basicAds",
enforcePurpose: true,
enforceVendor: true,
vendorExceptions: ["appnexus"]
}]
},
}
});
});

</script>
<script>
var div_1_sizes = [
[728, 90]
];

var PREBID_TIMEOUT = 3000;
var FAILSAFE_TIMEOUT = 5000;

var adUnits = [
{
code: '/19968336/header-bid-tag-0',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 13144370
}
}]
}
];

// ======== 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.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver,
timeout: PREBID_TIMEOUT
});
});

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


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

googletag.cmd.push(function() {
googletag.defineSlot('/19968336/header-bid-tag-0', div_1_sizes, 'div-1').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});

</script>

<article>
<p>
Give consent or make a choice in Europe. Module will add key/value pairs in ad calls. Check out for sd_rtd key in Google Ad call (https://securepubads.g.doubleclick.net/gampad/ads...) and in the payload sent to Xandr to endpoint https://ib.adnxs.com/ut/v3/prebid : tags[0].keywords.key[sd_rtd] should have an array of string as value. This array will mix user segments and/or page categories based on user's choices.
</p>
</article>
<h2>Basic Prebid.js Example</h2>
<h5>Div-1</h5>
<div id='div-1'>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.display('div-1');
});

</script>
</div>

</body>
</html>
3 changes: 2 additions & 1 deletion integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@
}, {
name: 'identityLink',
params: {
pid: '14' // Set your real identityLink placement ID here
pid: '14', // Set your real identityLink placement ID here
// notUse3P: true // true/false - If you do not want to use 3P endpoint to retrieve envelope. If you do not set this property to true, 3p endpoint will be fired. By default this property is undefined and 3p request will be fired.
},
storage: {
type: 'cookie',
Expand Down
24 changes: 23 additions & 1 deletion integrationExamples/mass/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,30 @@
pbjs.setConfig({
mass: {
enabled: true,

// official MASS-supported config:
dealIdPattern: /^MASS/i,
renderUrl: 'https://cdn.massplatform.net/bootloader.js',
dealIdPattern: /^MASS/i

// custom configs:
custom: [
// simple:
{
dealIdPattern: /^abc/i,
renderUrl: 'https://my.domain.com/script.js'
},

// flexible:
{
match: function(bid) {
// return true or false, based on given bid
},

render: function(payload) {
// render the ad
}
}
]
}
});
});
Expand Down
4 changes: 3 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"zeotapIdPlusIdSystem",
"haloIdSystem",
"quantcastIdSystem",
"deepintentDpesIdSystem",
"nextrollIdSystem",
"idxIdSystem",
"fabrickIdSystem",
Expand All @@ -36,6 +37,7 @@
"haloRtdProvider",
"jwplayerRtdProvider",
"reconciliationRtdProvider",
"geoedgeRtdProvider"
"geoedgeRtdProvider",
"sirdataRtdProvider"
]
}
Loading

0 comments on commit 7f186df

Please sign in to comment.