Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User ID Module #3424

Merged
merged 185 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from 159 commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
99c5436
add initial files
Dec 10, 2018
ba79f4f
add local storage and cookie browser support functions
Dec 11, 2018
152a4cd
added additional test cases for functions related to local storage an…
Dec 11, 2018
2431acb
added validate config function and first unit test
Dec 11, 2018
d631af9
add validate config test
Dec 11, 2018
afbc832
updated local storage key value to match change to requirements/spec
Dec 11, 2018
255d844
updated submodule config key names to match requirements/spec
Dec 11, 2018
1ba9285
added TODO with validation logic breakdown as well as a question on h…
Dec 11, 2018
d845a3c
add TODO addressing use-case: Publisher has integrated with OpenID on…
Dec 11, 2018
537e83b
fixed comment
Dec 11, 2018
60a394e
rearranged unit tests for config functions to be grouped correctly
Dec 11, 2018
7d19c32
added logic to valid that a submodule contains a config with a value …
Dec 12, 2018
9a74d0d
removed sinon mock of config.getConfig, replaced with obj literal def…
Dec 12, 2018
155a5b7
additional use cases added to validateConfig tests
Dec 12, 2018
6af977e
refactored init function
Dec 12, 2018
5892971
refactored to remove a function and reduce number of iterations of su…
Dec 12, 2018
8ae7caf
add logic to pass config value obj data to adapter, also a small amou…
Dec 12, 2018
8c52c07
Merge remote-tracking branch 'remote/master' into universal-id-module
Dec 12, 2018
a7f2dc0
added configuration examples to markdown file
Dec 12, 2018
34e82ed
add add request bid hook to the initSubmodules function
idettman Dec 13, 2018
a593833
added requestBidBook in preparation to test mock setup/configuration.…
idettman Dec 13, 2018
49fb9f5
refactored requestBidHook with dependency injection for unit testing
idettman Dec 13, 2018
0f77272
had to revert revision to use dependency injection in the requestBidH…
idettman Dec 13, 2018
12961b7
created initial file for integration example
idettman Dec 14, 2018
2c95510
updated integration using brett's test page.
idettman Dec 14, 2018
b0bd642
updated extendedBidRequestData to be a function expression, which all…
idettman Dec 14, 2018
7806939
removed redundant constant for enabled submodules within init submodules
idettman Dec 14, 2018
594029a
added retrieve storage value and logic to call submodule.getId if sto…
idettman Dec 14, 2018
0d966eb
added submodule getId fallback when storage value does not exist
idettman Dec 14, 2018
8d76584
extended addUnit bid requests with universalId data, add logging for …
idettman Dec 14, 2018
fd296c7
add logic to set storage and pass decoded data in getId response handler
idettman Dec 14, 2018
149758f
updated initModules unit test mock data to fix broken tests from prev…
idettman Dec 14, 2018
868304c
updated comments for consistency
idettman Dec 14, 2018
4217aa0
fixed module description comment
idettman Dec 14, 2018
5a0507d
add overrideId interface and implementation to the pubCommonId submodule
idettman Dec 14, 2018
a79eed7
fix to only check for override method value if submodule has a config…
idettman Dec 14, 2018
6c25037
added unit test for submodule override method implementation
idettman Dec 14, 2018
b8d9a72
completed the pubCommonId submodule getId implementation; changed pub…
idettman Dec 15, 2018
da0ef8f
changed openId submodule default expires value to today + 8 years; ad…
idettman Dec 15, 2018
cd84b83
fixed formatting to correct linting errors during building
idettman Dec 15, 2018
d646a85
update jsdoc comments for IdSubmodule
idettman Dec 15, 2018
04562a6
added jsdoc comments for overrideId submodule interface method
idettman Dec 15, 2018
d5f99cb
changed the overrideId return value conditional to require a valid ob…
idettman Dec 17, 2018
a0b5824
add ajax request to openId submodule getId, awaiting values for reque…
idettman Dec 17, 2018
4b16c9a
updated openId submodule getId error logging and callback handling
idettman Dec 17, 2018
30a197a
fix obj path access for syncDelay, updated example file with pubCommo…
idettman Dec 17, 2018
36a8afe
fix for broken unit tests resulting from update of overrideId additio…
idettman Dec 17, 2018
07620f8
replace use of built-in array find method, with import of 'core-js/li…
idettman Dec 17, 2018
fe12580
refactored config handling in initSubmodules to accept a plain js obj…
idettman Dec 17, 2018
ece6218
created init method to wrap initSubmodules with config
idettman Dec 17, 2018
79a0c09
refactored module's config to watch/handle changes
idettman Dec 17, 2018
98278b7
removed overrideId submodule interface, change openId to unifiedId
idettman Dec 18, 2018
3b396d9
update getId and decode uid data structure also updated integration e…
idettman Dec 18, 2018
ac5fa45
updated object structure for universal ids that is added to bid reque…
idettman Dec 18, 2018
226f526
updated markdown example configuration
idettman Dec 18, 2018
d68d485
fix for syncDelay, added auction end listener before setting syncDela…
idettman Dec 19, 2018
311b1df
update to prepare universalID object if adUnits exists
idettman Dec 19, 2018
786568d
add gdpr consent data to request bids hook, warn on not found, info i…
idettman Dec 19, 2018
51980f5
add test for valid gdpr consent string, exits universal id module on …
idettman Dec 19, 2018
83b23f7
update gdpr consent to check gdprApplies, add cmp code to integration…
idettman Dec 19, 2018
efed7b1
implemented test for gdpr consent to store locally (purpose #1)
idettman Dec 19, 2018
f773401
added consentString decode to check for purpose #1 (user consents to …
idettman Dec 19, 2018
840407e
fix initSubmodule function arguments for changed signature
idettman Dec 19, 2018
11100ec
changed submodule getId method signature to pass a consentData argument
idettman Dec 19, 2018
89d49ea
tests update with dependency container
idettman Dec 19, 2018
4f82d54
update spec to un-comment disabled expect statement
idettman Dec 20, 2018
548e56d
in-progress DI conversion
idettman Dec 20, 2018
829dc84
update to fix test missing dependency for utils
idettman Dec 20, 2018
e031a13
removed getIdCallbackHandler function because it was inlined within i…
idettman Dec 20, 2018
3e3f449
add unit test case for configurations that define invalid storage.typ…
idettman Dec 20, 2018
9a6f709
fixes for html5 storage in module and unit tests. temp comment-out fo…
idettman Dec 20, 2018
9ded3ec
fixes for html5 storage in module and unit tests. temp comment-out fo…
idettman Dec 20, 2018
cdfb027
added opt_out cookie logic to init
idettman Dec 20, 2018
f0512e7
in-progress commit to update getId method signature with initialized …
idettman Jan 2, 2019
8a450a5
changed priority to consent management module's value + 1
idettman Jan 3, 2019
aaf6be1
updated both submodule getId functions with consent data handling.
idettman Jan 3, 2019
e795e42
update hasGDPRConsent to remove unnecessary test for consentData obj …
idettman Jan 3, 2019
847f1f8
update to move local declarations outside if block, added local var f…
idettman Jan 3, 2019
7d8549d
changed log prefix to build the string locally instead of passing thr…
idettman Jan 3, 2019
45a1e84
Merge branch 'master' into universal-id-module
idettman Jan 4, 2019
47e3ece
bug fix for request bid hook priority race condition
idettman Jan 4, 2019
e1367c9
removed consentData prop from init dependencies obj, updated jsdoc co…
idettman Jan 4, 2019
e89d9ee
removed consentData prop from init arguments
idettman Jan 4, 2019
b5778b0
Merge branch 'master' into universal-id-module
idettman Jan 4, 2019
69323c1
update integration example to test gdpr cmpApi type of 'static'
idettman Jan 5, 2019
99d4635
refactor to combine request bid hooks into single hook, also other op…
idettman Jan 5, 2019
3d3bff4
additions/updates to logging, additions/updates to jsdoc comments, va…
idettman Jan 5, 2019
f09d5f9
fixed how GDPR purpose 1 permission is checked, removed decode functi…
idettman Jan 6, 2019
4e53386
fix for hasGDPRConsent functions, changed object prop accessor name f…
idettman Jan 7, 2019
264fec6
small changes to log messages and code formatting
idettman Jan 7, 2019
7e1f455
changed submodule property configKey to configName for consistency wi…
idettman Jan 7, 2019
b6792bc
updated logging message text and small format change
idettman Jan 7, 2019
798381d
updated jsdoc comment to reduce line length
idettman Jan 7, 2019
72c82f0
formatting fix and jsdoc update
idettman Jan 7, 2019
12bf1ff
reverted changes to support universal id in rubiconBidAdapter, will o…
idettman Jan 7, 2019
72d89a6
added logging messages to catch statements
idettman Jan 7, 2019
f40925d
fix unit tests using the document cookie
idettman Jan 8, 2019
afa7ffb
fix to extra module name in log message
idettman Jan 9, 2019
cc5bf17
changed function return type array to undefined on invalid config
idettman Jan 9, 2019
b07fccd
moved encodeURIComponenent and decodeURIComponenent into setCookie an…
idettman Jan 9, 2019
9fb7a49
refactor to resolve issues creating certain unit tests
idettman Jan 10, 2019
851b0c5
add tests for config variations, small fixes for issues found writing…
idettman Jan 10, 2019
7f99ecc
removed debug console.log statements
idettman Jan 10, 2019
e47ee19
removed set initializedSubmodules value in init
idettman Jan 10, 2019
b8441c6
fix to remove test cookie from spec, updated example with submodule c…
idettman Jan 10, 2019
a33f5bb
added tests checking that config submodule props create correct numbe…
idettman Jan 10, 2019
70be9b0
added test for syncDelay config update
idettman Jan 10, 2019
002d77b
fixes for LGTM and imports for src are now relative
idettman Jan 11, 2019
51980b7
Merge branch 'master' of https://github.com/prebid/Prebid.js into add…
idettman Jan 11, 2019
2230230
formatting fix semicolon
idettman Jan 11, 2019
62d451c
test reverted to debug circleci failure
idettman Jan 11, 2019
179d3d7
changed request bids hook priority to load after consentManagement
Jan 16, 2019
dc63661
updated from remote master
Jan 18, 2019
84c8f23
test to resolve circle ci errors
Jan 18, 2019
b1d21b0
test to resolve circle ci errors
Jan 18, 2019
ce9c99e
fixed name camel case error
Jan 18, 2019
c556c9d
changed unifiedid decode test property name from pubcid to ttid
Jan 22, 2019
77c558f
Merge branch 'master' of https://github.com/prebid/Prebid.js into add…
Jan 22, 2019
409426b
Merge branch 'master' of https://github.com/prebid/Prebid.js into add…
Jan 22, 2019
df97514
add universal id support to pbs bid adapter
Jan 22, 2019
fa5e73f
moved universal id pbs adapter support from this branch to it's own b…
Jan 22, 2019
209bdd2
reverted pbs adapter removal
Jan 22, 2019
f8904fa
always add ext.prebid.targeting.includewinners: true for openrtb
Jan 31, 2019
6b98636
removed unnecessary code
Jan 31, 2019
15efce0
renamed
Jan 31, 2019
c6dfe35
more renaming
Jan 31, 2019
e7b6632
rename comment
Jan 31, 2019
996638e
bugfixes and code removal
Feb 1, 2019
9543cea
reverted changes
Feb 1, 2019
ca78336
renamed
Feb 1, 2019
a9cc6b8
fix
Feb 1, 2019
ced7677
formatting update
Feb 1, 2019
3e76fde
bugfix for syncDelay in bidHook
Feb 1, 2019
c7b3518
fix syncDelay === 0
Feb 1, 2019
26284f0
revisions from review with e.harper
Feb 1, 2019
6e74450
fix for storing unifiedid obj in local storage
Feb 1, 2019
0a4aa14
bug fix for expires days conversion
Feb 1, 2019
d0ef78b
changed default syncDelay
Feb 1, 2019
f5e6bdd
removed comment example since it's in the markdown file
Feb 1, 2019
7456c14
added/updated comments
Feb 2, 2019
b17299a
tiny update to logic adding data to bids
Feb 2, 2019
0ad09aa
removed commented code
Feb 2, 2019
d38f829
formatting adjusted for consistency and comments added/updated
Feb 2, 2019
d3a7ce2
bugfix changed conditional to use and instead of or
Feb 2, 2019
b6a89bb
Merge branch 'master-rubicon-repo' into add-universal-id-module
Feb 2, 2019
4dee294
optimization code removal
Feb 2, 2019
584e49c
updated bidRequestHook to reflect changes made in hooks.js, ect
Feb 2, 2019
71d6d9f
fixes for unit tests
Feb 4, 2019
46c6c62
added more unit tests as well as small fixes for tests
Feb 4, 2019
8fc70c9
fixed import path
Feb 4, 2019
19e65a8
removed unused import and sinon sandbox
Feb 4, 2019
66da111
remove exports for unnecessary objects
Feb 4, 2019
21f70d3
Merge branch 'master-rubicon-repo' into add-universal-id-module
Feb 4, 2019
f8f3158
fix for circleci tests
Feb 4, 2019
315e2da
fix for util.setCookie exp format
Feb 4, 2019
baa7f1a
renamed module name references to User ID
Feb 4, 2019
9a0eb8b
removed test for cookies enabled around the opt out, since the cookie…
Feb 6, 2019
b382da1
add try catch around pubcommonid external function call, removed unus…
Feb 7, 2019
407fe4b
fix for pub common id getId try catch
Feb 7, 2019
8d635ff
Add microadBidAdapter
Feb 15, 2019
3309911
change unified id to require either a url or partner config param
Feb 25, 2019
3055b90
Remove unnecessary encodeURIComponent from microadBidAdapter
Feb 26, 2019
67fb91b
Submit Advangelists Prebid Adapter
Feb 26, 2019
3ebb916
Submit Advangelists Prebid Adapter 1.1
Feb 27, 2019
4f5c451
Correct procudtion endpoint for prebid
Feb 28, 2019
2dc6d1d
Merge branch 'microad-bid-adapter' of git://github.com/strong-zero/Pr…
Feb 28, 2019
61fafa0
Merge branch 'master' of https://github.com/prebid/Prebid.js into add…
Feb 28, 2019
fa3e081
Merge remote-tracking branch 'origin/master' into master-rubicon-clean
Mar 18, 2019
600a46e
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Mar 18, 2019
7f578b3
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 23, 2019
701c025
updating example pubcid
bretg Mar 26, 2019
1d250ec
Merge branch 'add-universal-id-module' of https://github.com/rubicon-…
Mar 26, 2019
176a312
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 26, 2019
7585942
added support to opt-out with _pubcid_optout
Mar 26, 2019
14b1307
clear _pubcid_optout before tests
Mar 27, 2019
9f9f15a
disabled test that keeps timing out on circleci
Mar 27, 2019
b520dc4
added logic for optout set in html5 local storage
Apr 3, 2019
efc5714
update fix conditional typeo
Apr 3, 2019
43d5352
Merge branches 'add-universal-id-module' and 'master' of https://gith…
Apr 3, 2019
7f48608
removed skip on userId test
Apr 3, 2019
8cb9983
added async done function call for failed circleci test
Apr 3, 2019
282a1f4
update done called in bidsBackHandler in failed circleci test
Apr 3, 2019
d838d9b
fix for lint error missing space after property name
Apr 3, 2019
2a0e354
removed test that passes locally but fails with a timeout exceeded er…
Apr 3, 2019
187973d
Merge branch 'master' of https://github.com/prebid/Prebid.js into add…
Apr 3, 2019
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
212 changes: 212 additions & 0 deletions integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
<html>
<head>
<script>
(function(window, document) {
if (!window.__cmp) {
window.__cmp = (function() {
var listen = window.attachEvent || window.addEventListener;
listen('message', function(event) {
window.__cmp.receiveMessage(event);
}, false);

function addLocatorFrame() {
if (!window.frames['__cmpLocator']) {
if (document.body) {
var frame = document.createElement('iframe');
frame.style.display = 'none';
frame.name = '__cmpLocator';
document.body.appendChild(frame);
} else {
setTimeout(addLocatorFrame, 5);
}
}
}
addLocatorFrame();

var commandQueue = [];
var cmp = function(command, parameter, callback) {
if (command === 'ping') {
if (callback) {
callback({
gdprAppliesGlobally: !!(window.__cmp && window.__cmp.config && window.__cmp.config.storeConsentGlobally),
cmpLoaded: false
});
}
} else {
commandQueue.push({
command: command,
parameter: parameter,
callback: callback
});
}
};
cmp.commandQueue = commandQueue;
cmp.receiveMessage = function(event) {
var data = event && event.data && event.data.__cmpCall;
if (data) {
commandQueue.push({
callId: data.callId,
command: data.command,
parameter: data.parameter,
event: event
});
}
};
cmp.config = {
//
// Modify config values here
//
// globalVendorListLocation: 'https://vendorlist.consensu.org/vendorlist.json',
// customPurposeListLocation: './purposes.json',
// globalConsentLocation: './portal.html',
// storeConsentGlobally: false,
// storePublisherData: false,
logging: 'debug'//,
// localization: {},
// forceLocale: 'en-us'
};
return cmp;
}());
var t = document.createElement('script');
t.async = false;
t.src = 'http://acdn.adnxs.com/cmp/cmp.bundle.js';
var tag = document.getElementsByTagName('head')[0];
tag.appendChild(t);
}
})(window, document);
// window.__cmp('showConsentTool');
</script>

<script>
var FAILSAFE_TIMEOUT = 2000;

var adUnits = [
{
code: 'test-div',
sizes: [[300,250],[300,600],[728,90]],
bids: [
{
bidder: 'rubicon',
params: {
accountId: '1001',
siteId: '113932',
zoneId: '535510'
}
}
]
}
];

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
</script>
<script src="../../build/dev/prebid.js" async></script>

<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});

pbjs.que.push(function() {
pbjs.setConfig({
debug: true,
consentManagement: {
cmpApi: 'iab',
timeout: 1000,
allowAuctionWithoutConsent: true
},
// consentManagement: {
// cmpApi: 'static',
// consentData: {
// consentString: 'BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA'
// vendorData: {
// purposeConsents: {
// '1': true
// }
// }
// }
// },
usersync: {
userIds: [{
name: "unifiedId",
params: {
partner: "prebid",
url: "http://match.adsrvr.org/track/rid?ttd_pid=prebid&fmt=json"
},
storage: {
type: "html5",
name: "unifiedid",
expires: 30
},

}, {
name: "pubCommonId",
storage: {
type: "cookie",
name: "pubcid",
expires: 365
},
// value: {
// foo: '9879878907987',
// bar:'93939'
// }
}],
syncDelay: 5000
}
});
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
});
});

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

setTimeout(function() {
sendAdserverRequest();
}, FAILSAFE_TIMEOUT);
</script>

<script>
(function () {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script>
googletag.cmd.push(function() {
googletag.defineSlot('/112115922/FL_PB_MedRect', [[300, 250],[300,600]], 'test-div').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
<h2>Rubicon Project Prebid</h2>

<div id='test-div'>
<script>
googletag.cmd.push(function() { googletag.display('test-div'); });
</script>
</div>
</body>
</html>
Loading