prebid.js 7.26.0 → 7.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/issue_tracker.yml +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adWMGAnalyticsAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adhashBidAdapter.js +1 -1
- package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxAnalyticsAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/admaticBidAdapter.js +1 -1
- package/dist/admixerBidAdapter.js +1 -1
- package/dist/adomikAnalyticsAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adxpremiumAnalyticsAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -0
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/analyticsAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/atsAnalyticsAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidViewability.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/bucksenseBidAdapter.js +1 -1
- package/dist/byDataAnalyticsAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertAnalyticsAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/datablocksAnalyticsAdapter.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/discoveryBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningAnalyticsAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/fluctBidAdapter.js +1 -1
- package/dist/ftrackIdSystem.js +1 -1
- package/dist/gdprEnforcement.js +1 -1
- package/dist/genericAnalyticsAdapter.js +1 -0
- package/dist/geoedgeRtdProvider.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/glomexBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/googleAnalyticsAdapter.js +1 -1
- package/dist/gravitoIdSystem.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/growthCodeAnalyticsAdapter.js +1 -0
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronAnalyticsAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/invisiblyAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerRtdProvider.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kinessoIdSystem.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveIntentAnalyticsAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/lotamePanoramaIdSystem.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediagoBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +206 -202
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxAnalyticsAdapter.js +1 -1
- package/dist/optimonAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pbsExtensions.js +1 -1
- package/dist/pianoDmpAnalyticsAdapter.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
- package/dist/pubCommonId.js +1 -1
- package/dist/pubProvidedIdSystem.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubperfAnalyticsAdapter.js +1 -1
- package/dist/pubstackAnalyticsAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pulsepointAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/quantcastIdSystem.js +1 -1
- package/dist/rasBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/realvuAnalyticsAdapter.js +1 -1
- package/dist/redtramBidAdapter.js +1 -0
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevantAnalyticsAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rivrAnalyticsAdapter.js +1 -1
- package/dist/roxotAnalyticsAdapter.js +1 -1
- package/dist/rtbhouseBidAdapter.js +1 -1
- package/dist/rtdModule.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/s2sTesting.js +1 -1
- package/dist/scaleableAnalyticsAdapter.js +1 -1
- package/dist/schain.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharedIdSystem.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/sigmoidAnalyticsAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiAnalyticsAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/staqAnalyticsAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tapadIdSystem.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teadsIdSystem.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yandexBidAdapter.js +1 -1
- package/dist/yieldlabBidAdapter.js +1 -1
- package/dist/yieldliftBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/yuktamediaAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/growthcode.html +134 -0
- package/libraries/analyticsAdapter/AnalyticsAdapter.js +95 -102
- package/libraries/ortb2.5StrictTranslator/dsl.js +54 -0
- package/libraries/ortb2.5StrictTranslator/spec.js +81 -0
- package/libraries/ortb2.5StrictTranslator/translator.js +37 -0
- package/libraries/ortb2.5Translator/translator.js +82 -0
- package/modules/33acrossIdSystem.js +3 -0
- package/modules/adhashBidAdapter.js +115 -30
- package/modules/adhashBidAdapter.md +1 -3
- package/modules/admaticBidAdapter.js +10 -1
- package/modules/admixerBidAdapter.js +1 -1
- package/modules/aidemBidAdapter.js +492 -0
- package/modules/aidemBidAdapter.md +187 -0
- package/modules/browsiRtdProvider.js +6 -4
- package/modules/bucksenseBidAdapter.js +1 -1
- package/modules/criteoBidAdapter.js +3 -3
- package/modules/discoveryBidAdapter.js +3 -0
- package/modules/eplanningBidAdapter.js +2 -6
- package/modules/fluctBidAdapter.js +5 -0
- package/modules/gdprEnforcement.js +26 -24
- package/modules/genericAnalyticsAdapter.js +157 -0
- package/modules/geoedgeRtdProvider.js +22 -0
- package/modules/glomexBidAdapter.js +2 -0
- package/modules/gravitoIdSystem.js +3 -4
- package/modules/gridBidAdapter.js +1 -1
- package/modules/gridNMBidAdapter.js +1 -1
- package/modules/growthCodeAnalyticsAdapter.js +176 -0
- package/modules/growthCodeAnalyticsAdapter.md +41 -0
- package/modules/impactifyBidAdapter.js +19 -1
- package/modules/jwplayerRtdProvider.js +1 -2
- package/modules/kargoBidAdapter.js +1 -1
- package/modules/lassoBidAdapter.js +8 -4
- package/modules/limelightDigitalBidAdapter.js +1 -1
- package/modules/liveIntentIdSystem.js +1 -2
- package/modules/mediagoBidAdapter.js +2 -1
- package/modules/minutemediaBidAdapter.md +3 -3
- package/modules/nexx360BidAdapter.js +264 -138
- package/modules/openxBidAdapter.md +15 -14
- package/modules/pubCommonId.js +2 -1
- package/modules/pubProvidedIdSystem.js +2 -0
- package/modules/rasBidAdapter.js +8 -3
- package/modules/rasBidAdapter.md +16 -15
- package/modules/redtramBidAdapter.js +155 -0
- package/modules/redtramBidAdapter.md +33 -0
- package/modules/riseBidAdapter.js +15 -0
- package/modules/riseBidAdapter.md +3 -3
- package/modules/rtbhouseBidAdapter.js +90 -29
- package/modules/rubiconBidAdapter.js +2 -1
- package/modules/seedtagBidAdapter.js +67 -56
- package/modules/seedtagBidAdapter.md +60 -0
- package/modules/sharedIdSystem.js +3 -1
- package/modules/smartxBidAdapter.js +1 -1
- package/modules/smnBidAdapter.md +52 -0
- package/modules/taboolaBidAdapter.js +20 -7
- package/modules/tripleliftBidAdapter.js +1 -1
- package/modules/ttdBidAdapter.js +4 -0
- package/modules/vidazooBidAdapter.js +31 -8
- package/modules/yandexBidAdapter.js +85 -19
- package/modules/yandexBidAdapter.md +7 -7
- package/modules/yieldlabBidAdapter.js +10 -4
- package/modules/yieldliftBidAdapter.js +3 -3
- package/package.json +2 -2
- package/src/auction.js +30 -4
- package/src/consentHandler.js +8 -0
- package/src/constants.json +2 -1
- package/src/events.js +4 -0
- package/src/native.js +31 -20
- package/src/refererDetection.js +6 -1
- package/src/storageManager.js +6 -3
- package/test/helpers/analytics.js +34 -0
- package/test/helpers/refererDetectionHelper.js +88 -0
- package/test/mocks/analyticsStub.js +3 -1
- package/test/spec/AnalyticsAdapter_spec.js +119 -116
- package/test/spec/auctionmanager_spec.js +119 -1
- package/test/spec/modules/33acrossIdSystem_spec.js +4 -1
- package/test/spec/modules/adWMGAnalyticsAdapter_spec.js +10 -8
- package/test/spec/modules/adagioAnalyticsAdapter_spec.js +18 -25
- package/test/spec/modules/adhashBidAdapter_spec.js +65 -11
- package/test/spec/modules/aidemBidAdapter_spec.js +664 -0
- package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +0 -2
- package/test/spec/modules/browsiRtdProvider_spec.js +2 -1
- package/test/spec/modules/concertAnalyticsAdapter_spec.js +2 -4
- package/test/spec/modules/enrichmentFpdModule_spec.js +3 -2
- package/test/spec/modules/eplanningAnalyticsAdapter_spec.js +0 -3
- package/test/spec/modules/eplanningBidAdapter_spec.js +4 -4
- package/test/spec/modules/fluctBidAdapter_spec.js +37 -1
- package/test/spec/modules/fpdModule_spec.js +1 -1
- package/test/spec/modules/gdprEnforcement_spec.js +115 -68
- package/test/spec/modules/genericAnalyticsAdapter_spec.js +284 -0
- package/test/spec/modules/geoedgeRtdProvider_spec.js +15 -0
- package/test/spec/modules/glomexBidAdapter_spec.js +4 -0
- package/test/spec/modules/gravitoIdSystem_spec.js +1 -1
- package/test/spec/modules/growthCodeAnalyticsAdapter_spec.js +70 -0
- package/test/spec/modules/impactifyBidAdapter_spec.js +13 -0
- package/test/spec/modules/invisiblyAnalyticsAdapter_spec.js +17 -27
- package/test/spec/modules/jwplayerRtdProvider_spec.js +3 -3
- package/test/spec/modules/konduitAnalyticsAdapter_spec.js +0 -2
- package/test/spec/modules/liveIntentAnalyticsAdapter_spec.js +3 -6
- package/test/spec/modules/medianetAnalyticsAdapter_spec.js +7 -1
- package/test/spec/modules/nexx360BidAdapter_spec.js +441 -221
- package/test/spec/modules/optimonAnalyticsAdapter_spec.js +3 -11
- package/test/spec/modules/pianoDmpAnalyticsAdapter_spec.js +4 -11
- package/test/spec/modules/prebidmanagerAnalyticsAdapter_spec.js +3 -12
- package/test/spec/modules/pubperfAnalyticsAdapter_spec.js +6 -19
- package/test/spec/modules/pubstackAnalyticsAdapter_spec.js +3 -17
- package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +13 -19
- package/test/spec/modules/rasBidAdapter_spec.js +5 -1
- package/test/spec/modules/redtramBidAdapter_spec.js +256 -0
- package/test/spec/modules/riseBidAdapter_spec.js +24 -0
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +79 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +65 -92
- package/test/spec/modules/sigmoidAnalyticsAdapter_spec.js +4 -8
- package/test/spec/modules/sovrnAnalyticsAdapter_spec.js +6 -18
- package/test/spec/modules/taboolaBidAdapter_spec.js +39 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +3 -10
- package/test/spec/modules/ttdBidAdapter_spec.js +50 -9
- package/test/spec/modules/vidazooBidAdapter_spec.js +173 -27
- package/test/spec/modules/yandexBidAdapter_spec.js +22 -13
- package/test/spec/modules/yieldlabBidAdapter_spec.js +49 -20
- package/test/spec/modules/yieldliftBidAdapter_spec.js +1 -1
- package/test/spec/modules/yieldoneAnalyticsAdapter_spec.js +5 -2
- package/test/spec/native_spec.js +68 -56
- package/test/spec/ortb2.5StrictTranslator/dsl_spec.js +137 -0
- package/test/spec/ortb2.5StrictTranslator/spec_spec.js +358 -0
- package/test/spec/ortb2.5StrictTranslator/translator_spec.js +16 -0
- package/test/spec/ortb2.5Translator/translator_spec.js +64 -0
- package/test/spec/refererDetection_spec.js +46 -95
- package/test/spec/unit/core/storageManager_spec.js +2 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { getStorageManager } from '../src/storageManager.js';
|
|
3
|
+
import { includes } from '../src/polyfill.js';
|
|
4
|
+
import { BANNER } from '../src/mediaTypes.js';
|
|
4
5
|
|
|
5
|
-
const VERSION = '
|
|
6
|
+
const VERSION = '3.2';
|
|
6
7
|
const BAD_WORD_STEP = 0.1;
|
|
7
8
|
const BAD_WORD_MIN = 0.2;
|
|
9
|
+
const ADHASH_BIDDER_CODE = 'adhash';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Function that checks the page where the ads are being served for brand safety.
|
|
@@ -54,43 +56,92 @@ function brandSafety(badWords, maxScore) {
|
|
|
54
56
|
return positive ? result : -result;
|
|
55
57
|
};
|
|
56
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Checks what rule will match in the given array with words
|
|
61
|
+
* @param {string} rule rule type (full, partial, starts, ends, regexp)
|
|
62
|
+
* @param {string} decodedWord decoded word
|
|
63
|
+
* @param {array} wordsToMatch array to find a match
|
|
64
|
+
* @returns {object|boolean} matched rule and occurances. If nothing is matched returns false
|
|
65
|
+
*/
|
|
66
|
+
const wordsMatchedWithRule = function (rule, decodedWord, wordsToMatch) {
|
|
67
|
+
if (rule === 'full' && wordsToMatch && wordsToMatch.includes(decodedWord)) {
|
|
68
|
+
return { rule, occurances: wordsToMatch.filter(element => element === decodedWord).length };
|
|
69
|
+
} else if (rule === 'partial' && wordsToMatch && wordsToMatch.some(element => element.indexOf(decodedWord) > -1)) {
|
|
70
|
+
return { rule, occurances: wordsToMatch.filter(element => element.indexOf(decodedWord) > -1).length };
|
|
71
|
+
} else if (rule === 'starts' && wordsToMatch && wordsToMatch.some(word => word.startsWith(decodedWord))) {
|
|
72
|
+
return { rule, occurances: wordsToMatch.filter(element => element.startsWith(decodedWord)).length };
|
|
73
|
+
} else if (rule === 'ends' && wordsToMatch && wordsToMatch.some(word => word.endsWith(decodedWord))) {
|
|
74
|
+
return { rule, occurances: wordsToMatch.filter(element => element.endsWith(decodedWord)).length };
|
|
75
|
+
} else if (rule === 'regexp' && wordsToMatch && wordsToMatch.some(element => element.match(new RegExp(decodedWord, 'i')))) {
|
|
76
|
+
return { rule, occurances: wordsToMatch.filter(element => element.match(new RegExp(decodedWord, 'i'))).length };
|
|
77
|
+
}
|
|
78
|
+
return false;
|
|
79
|
+
};
|
|
80
|
+
|
|
57
81
|
// Default parameters if the bidder is unable to send some of them
|
|
58
82
|
badWords = badWords || [];
|
|
59
83
|
maxScore = parseInt(maxScore) || 10;
|
|
60
84
|
|
|
61
85
|
try {
|
|
62
86
|
let score = 0;
|
|
87
|
+
const decodedUrl = decodeURI(window.top.location.href.substring(window.top.location.origin.length));
|
|
88
|
+
const wordsAndNumbersInUrl = decodedUrl
|
|
89
|
+
.replaceAll(/[-,\._/\?=&#%]/g, ' ')
|
|
90
|
+
.replaceAll(/\s\s+/g, ' ')
|
|
91
|
+
.toLowerCase()
|
|
92
|
+
.trim();
|
|
63
93
|
const content = window.top.document.body.innerText.toLowerCase();
|
|
64
|
-
const
|
|
94
|
+
const contentWords = content.trim().split(/\s+/).length;
|
|
95
|
+
// \p{L} matches a single unicode code point in the category 'letter'. Matches any kind of letter from any language.
|
|
96
|
+
const regexp = new RegExp('[\\p{L}]+', 'gu');
|
|
97
|
+
const words = content.match(regexp);
|
|
98
|
+
const wordsInUrl = wordsAndNumbersInUrl.match(regexp);
|
|
99
|
+
|
|
65
100
|
for (const [word, rule, points] of badWords) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
101
|
+
const decodedWord = rot13(word.toLowerCase());
|
|
102
|
+
|
|
103
|
+
// Checks the words in the url of the page only for negative words. Don't serve any ad when at least one match is found
|
|
104
|
+
if (points > 0) {
|
|
105
|
+
const matchedRuleInUrl = wordsMatchedWithRule(rule, decodedWord, wordsInUrl);
|
|
106
|
+
if (matchedRuleInUrl.rule) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Check if site content's words match any of our brand safety rules
|
|
112
|
+
const matchedRule = wordsMatchedWithRule(rule, decodedWord, words);
|
|
113
|
+
if (matchedRule.rule === 'full') {
|
|
114
|
+
score += scoreCalculator(points, matchedRule.occurances);
|
|
115
|
+
} else if (matchedRule.rule === 'partial') {
|
|
116
|
+
score += scoreCalculator(points, matchedRule.occurances);
|
|
117
|
+
} else if (matchedRule.rule === 'starts') {
|
|
118
|
+
score += scoreCalculator(points, matchedRule.occurances);
|
|
119
|
+
} else if (matchedRule.rule === 'ends') {
|
|
120
|
+
score += scoreCalculator(points, matchedRule.occurances);
|
|
121
|
+
} else if (matchedRule.rule === 'regexp') {
|
|
122
|
+
score += scoreCalculator(points, matchedRule.occurances);
|
|
72
123
|
}
|
|
73
124
|
}
|
|
74
|
-
return score < maxScore *
|
|
125
|
+
return score < (maxScore * contentWords) / 1000;
|
|
75
126
|
} catch (e) {
|
|
76
127
|
return true;
|
|
77
128
|
}
|
|
78
129
|
}
|
|
79
130
|
|
|
80
131
|
export const spec = {
|
|
81
|
-
code:
|
|
82
|
-
url: 'https://bidder.adhash.com/rtb?version=' + VERSION + '&prebid=true',
|
|
132
|
+
code: ADHASH_BIDDER_CODE,
|
|
83
133
|
supportedMediaTypes: [ BANNER ],
|
|
84
134
|
|
|
85
135
|
isBidRequestValid: (bid) => {
|
|
86
136
|
try {
|
|
87
|
-
const { publisherId, platformURL } = bid.params;
|
|
137
|
+
const { publisherId, platformURL, bidderURL } = bid.params;
|
|
88
138
|
return (
|
|
89
139
|
includes(Object.keys(bid.mediaTypes), BANNER) &&
|
|
90
140
|
typeof publisherId === 'string' &&
|
|
91
141
|
publisherId.length === 42 &&
|
|
92
142
|
typeof platformURL === 'string' &&
|
|
93
|
-
platformURL.length >= 13
|
|
143
|
+
platformURL.length >= 13 &&
|
|
144
|
+
(!bidderURL || bidderURL.indexOf('https://') === 0)
|
|
94
145
|
);
|
|
95
146
|
} catch (error) {
|
|
96
147
|
return false;
|
|
@@ -98,24 +149,51 @@ export const spec = {
|
|
|
98
149
|
},
|
|
99
150
|
|
|
100
151
|
buildRequests: (validBidRequests, bidderRequest) => {
|
|
152
|
+
const storage = getStorageManager({ bidderCode: ADHASH_BIDDER_CODE });
|
|
101
153
|
const { gdprConsent } = bidderRequest;
|
|
102
|
-
const { url } = spec;
|
|
103
154
|
const bidRequests = [];
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
155
|
+
const body = document.body;
|
|
156
|
+
const html = document.documentElement;
|
|
157
|
+
const pageHeight = Math.max(
|
|
158
|
+
body.scrollHeight,
|
|
159
|
+
body.offsetHeight,
|
|
160
|
+
html.clientHeight,
|
|
161
|
+
html.scrollHeight,
|
|
162
|
+
html.offsetHeight
|
|
163
|
+
);
|
|
164
|
+
const pageWidth = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
|
|
165
|
+
|
|
166
|
+
for (let i = 0; i < validBidRequests.length; i++) {
|
|
167
|
+
const bidderURL = validBidRequests[i].params.bidderURL || 'https://bidder.adhash.com';
|
|
168
|
+
const url = `${bidderURL}/rtb?version=${VERSION}&prebid=true`;
|
|
169
|
+
const index = Math.floor(Math.random() * validBidRequests[i].sizes.length);
|
|
170
|
+
const size = validBidRequests[i].sizes[index].join('x');
|
|
171
|
+
|
|
172
|
+
let recentAds = [];
|
|
173
|
+
if (storage.localStorageIsEnabled()) {
|
|
174
|
+
const prefix = validBidRequests[i].params.prefix || 'adHash';
|
|
175
|
+
recentAds = JSON.parse(storage.getDataFromLocalStorage(prefix + 'recentAds') || '[]');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Needed for the ad density calculation
|
|
179
|
+
var adHeight = validBidRequests[i].sizes[index][1];
|
|
180
|
+
var adWidth = validBidRequests[i].sizes[index][0];
|
|
181
|
+
if (!window.adsCount) {
|
|
182
|
+
window.adsCount = 0;
|
|
183
|
+
}
|
|
184
|
+
if (!window.adsTotalSurface) {
|
|
185
|
+
window.adsTotalSurface = 0;
|
|
186
|
+
}
|
|
187
|
+
window.adsTotalSurface += adHeight * adWidth;
|
|
188
|
+
window.adsCount++;
|
|
189
|
+
|
|
112
190
|
bidRequests.push({
|
|
113
191
|
method: 'POST',
|
|
114
192
|
url: url + '&publisher=' + validBidRequests[i].params.publisherId,
|
|
115
193
|
bidRequest: validBidRequests[i],
|
|
116
194
|
data: {
|
|
117
195
|
timezone: new Date().getTimezoneOffset() / 60,
|
|
118
|
-
location:
|
|
196
|
+
location: bidderRequest.refererInfo ? bidderRequest.refererInfo.topmostLocation : '',
|
|
119
197
|
publisherId: validBidRequests[i].params.publisherId,
|
|
120
198
|
size: {
|
|
121
199
|
screenWidth: window.screen.width,
|
|
@@ -131,10 +209,14 @@ export const spec = {
|
|
|
131
209
|
position: validBidRequests[i].adUnitCode
|
|
132
210
|
}],
|
|
133
211
|
blockedCreatives: [],
|
|
134
|
-
currentTimestamp: new Date().getTime(),
|
|
135
|
-
recentAds:
|
|
212
|
+
currentTimestamp: (new Date().getTime() / 1000) | 0,
|
|
213
|
+
recentAds: recentAds,
|
|
136
214
|
GDPRApplies: gdprConsent ? gdprConsent.gdprApplies : null,
|
|
137
|
-
GDPR: gdprConsent ? gdprConsent.consentString : null
|
|
215
|
+
GDPR: gdprConsent ? gdprConsent.consentString : null,
|
|
216
|
+
servedAdsCount: window.adsCount,
|
|
217
|
+
adsTotalSurface: window.adsTotalSurface,
|
|
218
|
+
pageHeight: pageHeight,
|
|
219
|
+
pageWidth: pageWidth
|
|
138
220
|
},
|
|
139
221
|
options: {
|
|
140
222
|
withCredentials: false,
|
|
@@ -157,7 +239,11 @@ export const spec = {
|
|
|
157
239
|
}
|
|
158
240
|
|
|
159
241
|
const publisherURL = JSON.stringify(request.bidRequest.params.platformURL);
|
|
242
|
+
const bidderURL = request.bidRequest.params.bidderURL || 'https://bidder.adhash.com';
|
|
160
243
|
const oneTimeId = request.bidRequest.adUnitCode + Math.random().toFixed(16).replace('0.', '.');
|
|
244
|
+
const globalScript = !request.bidRequest.params.globalScript
|
|
245
|
+
? `<script src="${bidderURL}/static/scripts/creative.min.js"></script>`
|
|
246
|
+
: '';
|
|
161
247
|
const bidderResponse = JSON.stringify({ responseText: JSON.stringify(responseBody) });
|
|
162
248
|
const requestData = JSON.stringify(request.data);
|
|
163
249
|
|
|
@@ -165,8 +251,7 @@ export const spec = {
|
|
|
165
251
|
requestId: request.bidRequest.bidId,
|
|
166
252
|
cpm: responseBody.creatives[0].costEUR,
|
|
167
253
|
ad:
|
|
168
|
-
`<div id="${oneTimeId}"></div
|
|
169
|
-
<script src="https://bidder.adhash.com/static/scripts/creative.min.js"></script>
|
|
254
|
+
`<div id="${oneTimeId}"></div>${globalScript}
|
|
170
255
|
<script>callAdvertiser(${bidderResponse},['${oneTimeId}'],${requestData},${publisherURL})</script>`,
|
|
171
256
|
width: request.bidRequest.sizes[0][0],
|
|
172
257
|
height: request.bidRequest.sizes[0][1],
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
```
|
|
4
4
|
Module Name: AdHash Bidder Adapter
|
|
5
5
|
Module Type: Bidder Adapter
|
|
6
|
-
Maintainer: damyan@adhash.
|
|
6
|
+
Maintainer: damyan@adhash.com
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
# Description
|
|
@@ -14,8 +14,6 @@ Here is what you need for Prebid integration with AdHash:
|
|
|
14
14
|
3. Use the Publisher ID and Platform URL as parameters in params.
|
|
15
15
|
|
|
16
16
|
Please note that a number of AdHash functionalities are not supported in the Prebid.js integration:
|
|
17
|
-
* Cookie-less frequency and recency capping;
|
|
18
|
-
* Audience segments;
|
|
19
17
|
* Price floors and passback tags, as they are not needed in the Prebid.js setup;
|
|
20
18
|
* Reservation for direct deals only, as bids are evaluated based on their price.
|
|
21
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getValue, logError, deepAccess, getBidIdParameter, isArray } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
4
|
-
|
|
4
|
+
let SYNC_URL = '';
|
|
5
5
|
const BIDDER_CODE = 'admatic';
|
|
6
6
|
export const spec = {
|
|
7
7
|
code: BIDDER_CODE,
|
|
@@ -59,6 +59,15 @@ export const spec = {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
if (payload) {
|
|
62
|
+
switch (bidderName) {
|
|
63
|
+
case 'pixad':
|
|
64
|
+
SYNC_URL = 'https://static.pixad.com.tr/sync.html';
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
SYNC_URL = 'https://cdn.serve.admatic.com.tr/showad/sync.html';
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
return { method: 'POST', url: `https://${host}/pb?bidder=${bidderName}`, data: payload, options: { contentType: 'application/json' } };
|
|
63
72
|
}
|
|
64
73
|
},
|
|
@@ -5,7 +5,7 @@ import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';
|
|
|
5
5
|
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
6
6
|
|
|
7
7
|
const BIDDER_CODE = 'admixer';
|
|
8
|
-
const ALIASES = ['go2net', 'adblender', 'adsyield', 'futureads'];
|
|
8
|
+
const ALIASES = ['go2net', 'adblender', 'adsyield', 'futureads', 'smn'];
|
|
9
9
|
const ENDPOINT_URL = 'https://inv-nets.admixer.net/prebid.1.2.aspx';
|
|
10
10
|
export const spec = {
|
|
11
11
|
code: BIDDER_CODE,
|