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

Pixfuture Bid Adapter: updated the getUserSyncs method #7456

Merged
merged 31 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
407ad54
Add files via upload
pixfuture-media Jun 11, 2021
dbf8c07
Add files via upload
pixfuture-media Jun 11, 2021
d6fcf88
Update pixfutureBidAdapter.md
pixfuture-media Jun 11, 2021
1e6f8dc
Update pixfutureBidAdapter.md
pixfuture-media Jun 11, 2021
e1d4a19
Update pixfutureBidAdapter.js
pixfuture-media Jun 11, 2021
c8c9f8b
Update pixfutureBidAdapter_spec.js
pixfuture-media Jun 11, 2021
b756f1b
Update pixfutureBidAdapter.js
pixfuture-media Jun 11, 2021
46540e4
Update pixfutureBidAdapter.js
pixfuture-media Jun 11, 2021
563ba7c
Update pixfutureBidAdapter.js
pixfuture-media Jun 14, 2021
54e8715
Merge branch 'prebid:master' into master
pixfuture-media Jun 14, 2021
cc4f7f4
Update pixfutureBidAdapter.md
pixfuture-media Jun 21, 2021
3a9ecb4
Update pixfutureBidAdapter.js
pixfuture-media Jun 21, 2021
96babdd
Update pixfutureBidAdapter.js
pixfuture-media Jun 22, 2021
a28d1fc
Update pixfutureBidAdapter.js
pixfuture-media Jun 23, 2021
218d6d7
Update pixfutureBidAdapter.js
pixfuture-media Jun 23, 2021
2baa588
Add files via upload
pixfuture-media Jun 23, 2021
017b904
Update pixfutureBidAdapter.js
pixfuture-media Jun 23, 2021
5a98e75
Update pixfutureBidAdapter.md
pixfuture-media Jun 24, 2021
7710dd9
Update pixfutureBidAdapter.md
pixfuture-media Jul 12, 2021
263d3c8
Update pixfutureBidAdapter.js
pixfuture-media Aug 6, 2021
6843bb7
Update pixfutureBidAdapter.js
pixfuture-media Sep 22, 2021
d9f26fb
Update pixfutureBidAdapter.js
pixfuture-media Sep 22, 2021
58c0685
Update pixfutureBidAdapter.js
pixfuture-media Sep 22, 2021
f6ccbe3
Pixfuture Bid Adapter: updated the getUserSyncs method and changed ut…
pixfuture-media Sep 29, 2021
181dbec
Fixed utls import
pixfuture-media Sep 29, 2021
d15c6b5
Bugfixing remove non used fill import
pixfuture-media Sep 29, 2021
3fb2b58
Update pixfutureBidAdapter.js
pixfuture-media Sep 30, 2021
d93aa10
resolving conflicts
PolishchukPixFuture Oct 13, 2021
08ab046
Merge branch 'master' into prebid-conflicts
ciberfafa Oct 13, 2021
411dc74
Merge pull request #1 from PixFuture-Media-Inc/prebid-conflicts
ciberfafa Oct 13, 2021
ced95b1
multiline fix
PolishchukPixFuture Oct 13, 2021
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
28 changes: 24 additions & 4 deletions modules/pixfutureBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, isEmpty, transformBidderParamKeywords, isFn } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';
import { BANNER } from '../src/mediaTypes.js';
import { config } from '../src/config.js';
import includes from 'core-js-pure/features/array/includes.js';
import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, isEmpty, transformBidderParamKeywords, isFn } from '../src/utils.js';
import { auctionManager } from '../src/auctionManager.js';
import find from 'core-js-pure/features/array/find.js';

Expand All @@ -12,7 +12,7 @@ const storageManager = getStorageManager();
const USER_PARAMS = ['age', 'externalUid', 'segments', 'gender', 'dnt', 'language'];
export const spec = {
code: 'pixfuture',
hostname: 'https://prebid-js.pixfuture.com',
hostname: 'https://gosrv.pixfuture.com',

getHostname() {
let ret = this.hostname;
Expand Down Expand Up @@ -77,7 +77,7 @@ export const spec = {
};

if (bidderRequest && bidderRequest.uspConsent) {
payload.us_privacy = bidderRequest.uspConsent
payload.us_privacy = bidderRequest.uspConsent;
}

if (bidderRequest && bidderRequest.refererInfo) {
Expand Down Expand Up @@ -112,7 +112,7 @@ export const spec = {
}

const ret = {
url: `${hostname}/`,
url: `${hostname}/pixservices`,
method: 'POST',
options: {withCredentials: false},
data: {
Expand Down Expand Up @@ -153,6 +153,16 @@ export const spec = {

return bids;
},
getUserSyncs: function (syncOptions, bid, gdprConsent) {
var pixid = '';
if (typeof bid[0] === 'undefined' || bid[0] === null) { pixid = '0'; } else { pixid = bid[0].body.pix_id; }
if (syncOptions.iframeEnabled && hasPurpose1Consent({gdprConsent})) {
return [{
type: 'iframe',
url: 'https://gosrv.pixfuture.com/cookiesync?adsync=' + gdprConsent.consentString + '&pixid=' + pixid + '&gdprconcent=' + gdprConsent.gdprApplies
}];
}
}
};

function newBid(serverBid, rtbBid, placementId, uuid) {
Expand All @@ -179,6 +189,16 @@ function newBid(serverBid, rtbBid, placementId, uuid) {
return bid;
}

function hasPurpose1Consent(bidderRequest) {
let result = true;
if (bidderRequest && bidderRequest.gdprConsent) {
if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) {
result = !!(deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true);
}
}
return result;
}

// Functions related optional parameters
function bidToTag(bid) {
const tag = {};
Expand Down
127 changes: 127 additions & 0 deletions modules/pixfutureBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,130 @@ var adUnits = [{
"pix_id": "Abc123"
}];
```

# Test Example
...
<html>

<head>
<link rel="icon" type="image/png" href="/favicon.ico">
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>
<script async src="https://cdn.pixfuture.com/pixfuture_prebidjs/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: 'pixfuture',
params: {
"pix_id": "777"
}
}]
},
{
code: '/19968336/header-bid-tag-1',
mediaTypes: {
banner: {
sizes: div_2_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();
});
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>