Skip to content

Commit

Permalink
Weborama RTD submodule: specify list of bidders to share data (#8350)
Browse files Browse the repository at this point in the history
* update .submodules.json to include weborama rtd

update .submodules.json to include weborama rtd submodule

* add support to pubmatic

* improve test format

* improve test format ~

* add support to appnexus/xandr bidder

* fix issue when split set target in two steps: site and user centric data

* add support to rubicon old style

* fix code, update docs

* add support to global and bid ortb2

* remove unused code

* refactor code

* update bidder list

* add global level parameters

* change error to warning

* update doc

* refactor

* add field accountId

* update example

* refactor js concat string

* refactor js concat string 2

* update jsdoc

* correct jsdoc

* add support to pubmatic

* improve test format

* improve test format ~

* add support to appnexus/xandr bidder

* fix issue when split set target in two steps: site and user centric data

* add support to rubicon old style

* fix code, update docs

* add support to global and bid ortb2

* remove unused code

* refactor code

* update bidder list

* add global level parameters

* change error to warning

* update doc

* refactor

* add field accountId

* update example

* refactor js concat string

* refactor js concat string 2

* update jsdoc

* correct jsdoc

* fix log

* update example

* remove todo

* refactor duplicated code in config normalization

* fix jsdoc

* add main feature

* update jstag

* improve callback

* improve doc

* improve doc about ortb2

* refactor code

* refactor tests to use one adunit

* fix unit tests

* prepare to add support to webo lite

* refactor code

* reorder code to handle bid data

* finish unit test

* improve copy of data

* improve unit test by checking callbacks that alter bid data

* format source

* fix doc

* specify webo lite as site-centric data

* add check for profile format

* update doc and code

* update sendToBidder callback signature

* fix doc

* fix doc 2

* fix js example

* update doc

* improve doc

* fix doc for LiTE

* update code and tests

* update doc

* update unit test

* improve doc

* fix sfbx lite code, add isDefault flag on metadata

* remove unused imports in tests

* refactor code using ?. operator

* improve deep clone usage

* keep code less dinamic

* refactor thinking in the prebid 7

* format source

* format tests

* suppress mention to lite

* Revert "suppress mention to lite"

This reverts commit 43fa658.

* small fix

* refactor init submodule functions

* add new constants

* update example

* simplify code

* rename function, rewrite callbacks into () => notation

* update sfbx lite name

* fix doc
  • Loading branch information
peczenyj authored May 16, 2022
1 parent 5534049 commit 80ff16b
Show file tree
Hide file tree
Showing 4 changed files with 3,401 additions and 569 deletions.
76 changes: 65 additions & 11 deletions integrationExamples/gpt/weboramaRtdProvider_example.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<!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">
<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>

<body>
Expand All @@ -26,31 +27,39 @@
params: {
setPrebidTargeting: true, // optional
sendToBidders: true, // optional
onData: function (data, site) { // optional
var kind = (site) ? 'site' : 'user';
console.log('onData', kind, data);
onData: function (data, meta) { // optional
console.log('onData', data, meta);
},
weboCtxConf: {
token: "to-be-defined", // mandatory
targetURL: "https://prebid.org", // default is document.URL
setPrebidTargeting: true, // override param.setPrebidTargeting or default true
sendToBidders: true, // override param.sendToBidders or default true
defaultProfile: { // optional
webo_ctx: ['moon'],
webo_ctx: ["Rugby_Renault_c11495", "Sport_c11893"],
webo_ds: ['bar']
},
//, onData: function (data, ...) { ...}
// enabled: false,
//, onData: function (data,...) { ...}
},
weboUserDataConf: {
accountId: 12345, // optional
accountId: 12345, // recommended
setPrebidTargeting: true, // override param.setPrebidTargeting or default true
sendToBidders: true, // override param.sendToBidders or default true
sendToBidders: ['smartadserver'], // specify the bidder to share data
defaultProfile: { // optional
webo_cs: ['Red'],
webo_cs: ['red'],
webo_audiences: ['bam']
},
localStorageProfileKey: 'webo_wam2gam_entry', // default
// enabled: false,
//, onData: function (data,...) { ...}
},
sfbxLiteDataConf: {
enabled: true,
defaultProfile: { // optional
lite_occupation: ['gérant', 'bénévole'],
lite_hobbies: ['sport', 'cinéma'],
},
}
}
}]
Expand All @@ -62,6 +71,9 @@
var div_1_sizes = [
[300, 300]
];
var div_2_sizes = [
[600, 100]
];

var PREBID_TIMEOUT = 3000;
var FAILSAFE_TIMEOUT = 5000;
Expand Down Expand Up @@ -106,6 +118,46 @@
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 @@ -138,14 +190,14 @@
});
}


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

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 All @@ -154,18 +206,20 @@

<article>
<p>
test webo ctx using prebid.js
test webo rtd submodule with prebid.js
</p>
</article>
<h2>Basic Prebid.js Example</h2>
<h5>Div-1</h5>
<!-- /1056029/webo-ctx-prebid -->
<div id='div-gpt-ad-1620653642627-0' style='width: 300px; height: 300px;'>
<script type='text/javascript'>
googletag.cmd.push(function () {
googletag.display('div-gpt-ad-1620653642627-0');
});
</script>
</div>

<button onclick="googletag.cmd.push(function() { googletag.pubads().refresh(); });">
Show/Refresh Ad
</button>
Expand Down
Loading

0 comments on commit 80ff16b

Please sign in to comment.