Skip to content

Commit

Permalink
Consent management: update GDPR example
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed Jun 6, 2022
1 parent 80f86b1 commit 2345f04
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 228 deletions.
91 changes: 14 additions & 77 deletions integrationExamples/gpt/gdpr_hello_world.html
Original file line number Diff line number Diff line change
@@ -1,83 +1,19 @@
<html>
<head>
<script async src="../../build/dev/prebid.js"></script>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<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>
window._iub = window._iub || {};
_iub.csConfiguration = {
cookiePolicyId: 417383,
siteId: 1,
logLevel: 'error',
lang: 'en',
enableTcf: true,
};
</script>
<script src="//cdn.iubenda.com/cs/tcf/beta/stub.js"></script>
<script async src="//cdn.iubenda.com/cs/beta/iubenda_cs.js"></script>
<script async src="../../build/dev/prebid.js"></script>
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>

<script>
var PREBID_TIMEOUT = 700;
Expand Down Expand Up @@ -159,6 +95,7 @@
</head>

<body>

<h2>Prebid.js Test</h2>
<h5>Div-1</h5>
<div id='div-gpt-ad-1460505748561-0'>
Expand Down
151 changes: 0 additions & 151 deletions integrationExamples/gpt/gdpr_indefinite_timeout_exampe.html

This file was deleted.

0 comments on commit 2345f04

Please sign in to comment.