Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
186 changes: 186 additions & 0 deletions integrationExamples/gpt/liveIntentAnalyticsAdapterExample.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<html>
<head>
<link rel="icon" type="image/png" href="/favicon.png">
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<script>
window.liTreatmentRate = 1.0;
window.liModuleEnabled = true;
</script>
<script async src="../../build/dev/prebid.js"></script>
<script>
var div_1_sizes = [
[300, 250],
[300, 600]
];
var div_2_sizes = [
[728, 90],
[970, 250]
];
var PREBID_TIMEOUT = 1000;
var FAILSAFE_TIMEOUT = 3000;
var adUnits = [
{
code: '/19968336/header-bid-tag-0',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
siteId: 'examplePub123', // required
productId: 'siab|inview' // required
}
}]
},
{
code: '/19968336/header-bid-tag-1',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
siteId: 'examplePub123', // required
productId: 'siab|inview' // required
}
}]
}
];
// ======== 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({
debug: true,
realTimeData: {
dataProviders:[{
name: "liveintent",
waitForIt: true
}]
},
"consentManagement": {
"cmpApi": "static",
"consentData": {
"getTCData": {
"tcString": "CO-HDlqO-HDlqAKAXCENBDCsAP_AAH_AACiQHKNd_X_fb39j-_59_9t0eY1f9_7_v20zjgeds-8Nyd_X_L8X42M7vF36pq4KuR4Eu3LBIQFlHOHcTUmw6IkVqTPsak2Mr7NKJ7PEinMbe2dYGHtfn9VTuZKYr97s___z__-__v__75f_r-3_3_vp9V---_fA5QAkw1L4CLMSxwJJo0qhRAhCuJDoAQAUUIwtE1hASuCnZXAR-ggYAIDUBGBECDEFGLIIAAAAAkoiAkAPBAIgCIBAACAFSAhAARoAgsAJAwCAAUA0LACKAIQJCDI4KjlMCAiRaKCeSMASi72MMIQyigBoFH4AAAAA.cAAAAAAAAAAA",
"cmpId": 10,
"cmpVersion": 23,
"tcfPolicyVersion": 2,
"gdprApplies": true,
"cmpStatus": "loaded",
"eventStatus": "tcloaded",
"purpose": {
"consents": {
"1": true,
"2": true
}
},
"vendor": {
"consents": {
// add your GVL ID here and set to true to give consent within pbjs
"148": true, // liveintent
}
}
}
}
},
userSync: {
auctionDelay: 1000,
userIds: [
{
"name": "liveIntentId",
"params": {
"distributorId": "did-0000",
"activatePartialTreatment" : true,
"requestedAttributesOverrides": {
'sovrn': true,
'medianet': true,
'bidswitch': true,
},
"liCollectConfig" : {
"distributorId" : "did-0000"
}
},
"value" : {
"lipbid":
{
"segments": ["asa_1231", "lalo_4311", "liurl_99123"],
}
}
}
]
}
});
pbjs.enableAnalytics({
provider: 'liveintent',
options: {
sampling: 1,
sendAuctionInitEvents: true
}
});
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver,
timeout: PREBID_TIMEOUT
});
});
function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
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();
});
googletag.cmd.push(function() {
googletag.defineSlot('/19968336/header-bid-tag-1', div_2_sizes, 'div-2').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>
<body>
<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>
<br>
<h5>Div-2</h5>
<div id='div-2'>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.display('div-2');
});
</script>
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions modules/operaadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import {convertOrtbRequestToProprietaryNative} from '../src/native.js';
*/
const BIDDER_CODE = 'operaads';

const ENDPOINT = 'https://s.adx.opera.com/ortb/v2/';
const USER_SYNC_ENDPOINT = 'https://s.adx.opera.com/usersync/page';
const ENDPOINT = 'https://s.oa.opera.com/ortb/v2/';
const USER_SYNC_ENDPOINT = 'https://s.oa.opera.com/usersync/page';

const OUTSTREAM_RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js';

Expand Down
4 changes: 2 additions & 2 deletions modules/wurflRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getGlobal } from '../src/prebidGlobal.js';
// Constants
const REAL_TIME_MODULE = 'realTimeData';
const MODULE_NAME = 'wurfl';
const MODULE_VERSION = '2.3.0';
const MODULE_VERSION = '2.3.1';

// WURFL_JS_HOST is the host for the WURFL service endpoints
const WURFL_JS_HOST = 'https://prebid.wurflcloud.com';
Expand Down Expand Up @@ -1330,7 +1330,7 @@ function onAuctionEndEvent(auctionDetails, config, userConsent) {
for (let i = 0; i < bidsReceived.length; i++) {
const bid = bidsReceived[i];
const adUnitCode = bid.adUnitCode;
const bidderCode = bid.bidderCode || bid.bidder;
const bidderCode = bid.bidder || bid.bidderCode;
const key = adUnitCode + ':' + bidderCode;
bidResponseMap[key] = bid;
}
Expand Down
16 changes: 8 additions & 8 deletions test/spec/modules/operaadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe('Opera Ads Bid Adapter', function () {
const bidRequest = bidRequests[i];

expect(req.method).to.equal('POST');
expect(req.url).to.equal('https://s.adx.opera.com/ortb/v2/' +
expect(req.url).to.equal('https://s.oa.opera.com/ortb/v2/' +
bidRequest.params.publisherId + '?ep=' + bidRequest.params.endpointId);

expect(req.options).to.be.an('object');
Expand Down Expand Up @@ -546,8 +546,8 @@ describe('Opera Ads Bid Adapter', function () {
'id': '003004d9c05c6bc7fec0',
'impid': '22c4871113f461',
'price': 1.04,
'nurl': 'https://s.adx.opera.com/win',
'lurl': 'https://s.adx.opera.com/loss',
'nurl': 'https://s.oa.opera.com/win',
'lurl': 'https://s.oa.opera.com/loss',
'adm': '<img src="https://res.adx.opera.com/xxx.jpeg" width="300" height="250" />',
'adomain': [
'opera.com',
Expand Down Expand Up @@ -628,8 +628,8 @@ describe('Opera Ads Bid Adapter', function () {
'id': '003004d9c05c6bc7fec0',
'impid': '22c4871113f461',
'price': 1.04,
'nurl': 'https://s.adx.opera.com/win',
'lurl': 'https://s.adx.opera.com/loss',
'nurl': 'https://s.oa.opera.com/win',
'lurl': 'https://s.oa.opera.com/loss',
'adm': '<VAST version="2.0"><Ad id="static"><InLine><AdSystem>Static VAST Template</AdSystem><AdTitle>Static VAST Tag</AdTitle><Impression>http://example.com/pixel.gif?asi=[ADSERVINGID]</Impression><Creatives><Creative><Linear><Duration>00:00:08</Duration><TrackingEvents><Tracking event="start">http://example.com/pixel.gif</Tracking><Tracking event="firstQuartile">http://example.com/pixel.gif</Tracking><Tracking event="midpoint">http://example.com/pixel.gif</Tracking><Tracking event="thirdQuartile">http://example.com/pixel.gif</Tracking><Tracking event="complete">http://example.com/pixel.gif</Tracking><Tracking event="pause">http://example.com/pixel.gif</Tracking><Tracking event="mute">http://example.com/pixel.gif</Tracking><Tracking event="fullscreen">http://example.com/pixel.gif</Tracking></TrackingEvents><VideoClicks><ClickThrough>http://www.jwplayer.com/</ClickThrough><ClickTracking>http://example.com/pixel.gif?r=[REGULATIONS]&gdpr=[GDPRCONSENT]&pu=[PAGEURL]&da=[DEVICEUA]</ClickTracking></VideoClicks><MediaFiles><MediaFile type="video/mp4" bitrate="300" width="480" height="270"> http://example.com/uploads/myPrerollVideo.mp4</MediaFile></MediaFiles><Icons><Icon program="AdChoices" height="16" width="16" xPosition="right" yPosition="top"><StaticResource creativeType="image/png"> https://example.com/adchoices-sm.png</StaticResource><Iconclicks><IconClickThrough>https://sample-url.com</IconClickThrough></IconClicks></Icon></Icons></Linear></Creative></Creatives></InLine></Ad></VAST>',
'adomain': [
'opera.com',
Expand Down Expand Up @@ -698,8 +698,8 @@ describe('Opera Ads Bid Adapter', function () {
'id': '003004d9c05c6bc7fec0',
'impid': '22c4871113f461',
'price': 1.04,
'nurl': 'https://s.adx.opera.com/win',
'lurl': 'https://s.adx.opera.com/loss',
'nurl': 'https://s.oa.opera.com/win',
'lurl': 'https://s.oa.opera.com/loss',
'adm': '{"native":{"ver":"1.1","assets":[{"id":1,"required":1,"title":{"text":"The first personal browser"}},{"id":2,"required":1,"img":{"url":"https://res.adx.opera.com/xxx.png","w":720,"h":1280}},{"id":3,"required":1,"img":{"url":"https://res.adx.opera.com/xxx.png","w":60,"h":60}},{"id":4,"required":1,"data":{"value":"Download Opera","len":14}},{"id":5,"required":1,"data":{"value":"Opera","len":5}},{"id":6,"required":1,"data":{"value":"Download","len":8}}],"link":{"url":"https://www.opera.com/mobile/opera","clicktrackers":["https://thirdpart-click.tracker.com","https://t-odx.op-mobile.opera.com/click"]},"imptrackers":["https://thirdpart-imp.tracker.com","https://t-odx.op-mobile.opera.com/impr"],"jstracker":"<script src=\\"https://t-odx.op-mobile.opera.com/jstracker\\"></script>"}}',
'adomain': [
'opera.com',
Expand Down Expand Up @@ -782,7 +782,7 @@ describe('Opera Ads Bid Adapter', function () {
}
const userSyncPixels = spec.getUserSyncs(syncOptions)
expect(userSyncPixels).to.have.lengthOf(1);
expect(userSyncPixels[0].url).to.equal('https://s.adx.opera.com/usersync/page')
expect(userSyncPixels[0].url).to.equal('https://s.oa.opera.com/usersync/page')
});
});

Expand Down
Loading