Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pnhegde authored Sep 23, 2024
2 parents c01a8e9 + 1536afc commit 773e31c
Show file tree
Hide file tree
Showing 20 changed files with 3,247 additions and 6,272 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
- name: Check out PR
run: git checkout ${{ github.event.pull_request.head.sha }}

- name: Install dependencies
run: npm ci

- name: Run linter on PR
run: npx eslint --no-inline-config --format json $(cat __changed_files.txt | xargs stat --printf '%n\n' 2> /dev/null) > __pr.json || true

Expand Down
9 changes: 8 additions & 1 deletion modules/adnuntiusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,14 @@ export const spec = {

networks[network] = networks[network] || {};
networks[network].adUnits = networks[network].adUnits || [];
if (bidderRequest && bidderRequest.refererInfo) networks[network].context = bidderRequest.refererInfo.page;

const refererInfo = bidderRequest && bidderRequest.refererInfo ? bidderRequest.refererInfo : {};
if (refererInfo.page) {
networks[network].context = bidderRequest.refererInfo.page;
}
if (refererInfo.canonicalUrl) {
networks[network].canonical = bidderRequest.refererInfo.canonicalUrl;
}

const payloadRelatedData = storageTool.getPayloadRelatedData(bid.params.network);
if (Object.keys(payloadRelatedData).length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion modules/anonymisedRtdProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Anonymised’s Real-time Data Provider automatically obtains segment IDs from th
waitForIt: true,
params: {
cohortStorageKey: "cohort_ids",
bidders: ["smartadserver", "appnexus"],
bidders: ["appnexus", "onetag", "pubmatic", "smartadserver", ...],
segtax: 1000
}
}
Expand Down
19 changes: 14 additions & 5 deletions modules/consentManagementGpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {gppDataHandler} from '../src/adapterManager.js';
import {enrichFPD} from '../src/fpd/enrichment.js';
import {getGlobal} from '../src/prebidGlobal.js';
import {cmpClient, MODE_CALLBACK} from '../libraries/cmp/cmpClient.js';
import {GreedyPromise} from '../src/utils/promise.js';
import {GreedyPromise, defer} from '../src/utils/promise.js';
import {buildActivityParams} from '../src/activities/params.js';
import {consentManagementHook} from '../libraries/consentManagement/cmUtils.js';

Expand Down Expand Up @@ -72,7 +72,7 @@ export class GPPClient {

constructor(cmp) {
this.cmp = cmp;
[this.#resolve, this.#reject] = [0, 1].map(slot => (result) => {
[this.#resolve, this.#reject] = ['resolve', 'reject'].map(slot => (result) => {
while (this.#pending.length) {
this.#pending.pop()[slot](result);
}
Expand Down Expand Up @@ -103,6 +103,15 @@ export class GPPClient {
} else if (this.isCMPReady(event?.pingData || {}) && ['sectionChange', 'signalStatus'].includes(event?.eventName)) {
this.#resolve(this.updateConsent(event.pingData));
}
// NOTE: according to https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Core/CMP%20API%20Specification.md,
// > [signalStatus] Event is called whenever the display status of the CMP changes (e.g. the CMP shows the consent layer).
//
// however, from real world testing, at least some CMPs only trigger 'cmpDisplayStatus'
// other CMPs may do something else yet; here we just look for 'signalStatus: not ready' on any event
// to decide if consent data is likely to change
if (consentData != null && event?.pingData != null && !this.isCMPReady(event.pingData)) {
consentData = null;
}
}
});
}
Expand Down Expand Up @@ -136,9 +145,9 @@ export class GPPClient {
* @returns {Promise<{}>}
*/
nextUpdate() {
return new GreedyPromise((resolve, reject) => {
this.#pending.push([resolve, reject]);
});
const def = defer();
this.#pending.push(def);
return def.promise;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions modules/identityLinkIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ function getEnvelope(url, callback, configParams) {
utils.logInfo('identityLink: A 3P retrieval is attempted!');
setEnvelopeSource(false);
ajax(url, callbacks, undefined, { method: 'GET', withCredentials: true });
} else {
callback()
}
}

Expand Down
12 changes: 7 additions & 5 deletions modules/intentIqAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function readData(key) {

function initLsValues() {
if (iiqAnalyticsAnalyticsAdapter.initOptions.lsValueInitialized) return;
iiqAnalyticsAnalyticsAdapter.initOptions.fpid = JSON.parse(readData(FIRST_PARTY_KEY));
let iiqArr = config.getConfig('userSync.userIds').filter(m => m.name == 'intentIqId');
if (iiqArr && iiqArr.length > 0) iiqAnalyticsAnalyticsAdapter.initOptions.lsValueInitialized = true;
if (!iiqArr) iiqArr = [];
Expand All @@ -112,18 +111,19 @@ function initLsValues() {
if (iiqArr && iiqArr.length > 0) {
if (iiqArr[0].params && iiqArr[0].params.partner && !isNaN(iiqArr[0].params.partner)) {
iiqAnalyticsAnalyticsAdapter.initOptions.partner = iiqArr[0].params.partner;
iiqAnalyticsAnalyticsAdapter.initOptions.currentGroup = iiqAnalyticsAnalyticsAdapter.initOptions.fpid.group;
}

iiqAnalyticsAnalyticsAdapter.initOptions.browserBlackList = typeof iiqArr[0].params.browserBlackList === 'string' ? iiqArr[0].params.browserBlackList.toLowerCase() : '';
}
}

function initReadLsIds() {
if (isNaN(iiqAnalyticsAnalyticsAdapter.initOptions.partner) || iiqAnalyticsAnalyticsAdapter.initOptions.partner == -1) return;
try {
iiqAnalyticsAnalyticsAdapter.initOptions.dataInLs = null;
let iData = readData(FIRST_PARTY_DATA_KEY + '_' + iiqAnalyticsAnalyticsAdapter.initOptions.partner)
iiqAnalyticsAnalyticsAdapter.initOptions.fpid = JSON.parse(readData(FIRST_PARTY_KEY));
if (iiqAnalyticsAnalyticsAdapter.initOptions.fpid) {
iiqAnalyticsAnalyticsAdapter.initOptions.currentGroup = iiqAnalyticsAnalyticsAdapter.initOptions.fpid.group;
}
let iData = readData(FIRST_PARTY_DATA_KEY + '_' + iiqAnalyticsAnalyticsAdapter.initOptions.partner);
if (iData) {
iiqAnalyticsAnalyticsAdapter.initOptions.lsIdsInitialized = true;
let pData = JSON.parse(iData);
Expand All @@ -138,6 +138,8 @@ function initReadLsIds() {
function bidWon(args) {
if (!iiqAnalyticsAnalyticsAdapter.initOptions.lsValueInitialized) { initLsValues(); }

if (isNaN(iiqAnalyticsAnalyticsAdapter.initOptions.partner) || iiqAnalyticsAnalyticsAdapter.initOptions.partner == -1) return;

const currentBrowserLowerCase = detectBrowser();
if (iiqAnalyticsAnalyticsAdapter.initOptions.browserBlackList?.includes(currentBrowserLowerCase)) {
logError('IIQ ANALYTICS -> Browser is in blacklist!');
Expand Down
Loading

0 comments on commit 773e31c

Please sign in to comment.