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: redisigned user sync #9067

Merged
merged 5 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
"pixfutureBidAdapter",
"appnexusBidAdapter",
"consentManagement",
"gdprEnforcement"
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is for testing and should be removed from pr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Chris,

We removed modules.json and added info to https://github.com/prebid/prebid.github.io
Please let us know about our adapter status.

Regards,
Vitali I.

49 changes: 40 additions & 9 deletions modules/pixfutureBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ import {
transformBidderParamKeywords
} from '../src/utils.js';
import {auctionManager} from '../src/auctionManager.js';
import {hasPurpose1Consent} from '../src/utils/gpdr.js';

const SOURCE = 'pbjs';
const storageManager = getStorageManager({bidderCode: 'pixfuture'});
const USER_PARAMS = ['age', 'externalUid', 'segments', 'gender', 'dnt', 'language'];
let pixID = '';
const GVLID = 839;

export const spec = {
code: 'pixfuture',
gvlid: GVLID,
hostname: 'https://gosrv.pixfuture.com',

getHostname() {
Expand All @@ -41,6 +44,10 @@ export const spec = {
const tags = validBidRequests.map(bidToTag);
const hostname = this.getHostname();
return validBidRequests.map((bidRequest) => {
if (bidRequest.params.pix_id) {
pixID = bidRequest.params.pix_id
}

let referer = '';
if (bidderRequest && bidderRequest.refererInfo) {
referer = bidderRequest.refererInfo.page || '';
Expand Down Expand Up @@ -123,7 +130,7 @@ export const spec = {
const ret = {
url: `${hostname}/pixservices`,
method: 'POST',
options: {withCredentials: false},
options: {withCredentials: true},
data: {
v: $$PREBID_GLOBAL$$.version,
pageUrl: referer,
Expand Down Expand Up @@ -162,15 +169,39 @@ 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 [{
getUserSyncs: function (syncOptions, bid, gdprConsent, uspConsent) {
const syncs = [];

let syncurl = 'pixid=' + pixID;
let gdpr = (gdprConsent && gdprConsent.gdprApplies) ? 1 : 0;
let consent = gdprConsent ? encodeURIComponent(gdprConsent.consentString || '') : '';

// Attaching GDPR Consent Params in UserSync url
syncurl += '&gdprconcent=' + gdpr + '&adsync=' + consent;

// CCPA
if (uspConsent) {
syncurl += '&us_privacy=' + encodeURIComponent(uspConsent);
}

// coppa compliance
if (config.getConfig('coppa') === true) {
syncurl += '&coppa=1';
}

if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: 'https://gosrv.pixfuture.com/cookiesync?adsync=' + gdprConsent.consentString + '&pixid=' + pixid + '&gdprconcent=' + gdprConsent.gdprApplies
}];
url: 'https://gosrv.pixfuture.com/cookiesync?f=b&' + syncurl
});
} else {
syncs.push({
type: 'image',
url: 'https://gosrv.pixfuture.com/cookiesync?f=i&' + syncurl
});
}

return syncs;
}
};

Expand Down
7 changes: 6 additions & 1 deletion modules/pixfutureBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
gdpr_supported: true
usp_supported: true
coppa_supported: true
schain_supported: true
---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These adapter documentation highlights need to go in our docs repo here instead please -> https://github.com/prebid/prebid.github.io

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have located this information in the docs repo and removed it from the current .md file.

# Overview

```
Module Name: PixFuture Bid Adapter
Module Type: Bidder Adapter
Expand Down