@highfivve/ad-tag 5.8.17 → 5.8.18
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/lib/ads/labelConfigService.js +14 -1
- package/lib/ads/modules/ad-reload/index.js +146 -142
- package/lib/ads/modules/adex/index.js +106 -104
- package/lib/ads/modules/cleanup/index.js +64 -61
- package/lib/ads/modules/confiant/index.js +29 -29
- package/lib/ads/modules/emetriq/index.js +107 -102
- package/lib/ads/modules/generic-skin/index.js +128 -127
- package/lib/ads/modules/identitylink/index.js +37 -36
- package/lib/ads/modules/prebid-first-party-data/index.js +41 -43
- package/lib/ads/modules/pubstack/index.js +26 -24
- package/lib/ads/modules/sticky-footer-ad/index.js +25 -25
- package/lib/ads/modules/sticky-footer-ad-v2/index.js +25 -25
- package/lib/ads/modules/sticky-header-ad/index.js +44 -42
- package/lib/ads/modules/zeotap/index.js +93 -93
- package/lib/ads/moli.js +35 -22
- package/lib/bundle/adReload.js +2 -2
- package/lib/bundle/adex.js +2 -2
- package/lib/bundle/cleanup.js +2 -2
- package/lib/bundle/confiant.js +2 -2
- package/lib/bundle/emetriq.js +2 -2
- package/lib/bundle/identityLink.js +2 -2
- package/lib/bundle/prebidFirstPartyData.js +2 -2
- package/lib/bundle/pubstack.js +2 -2
- package/lib/bundle/skin.js +2 -2
- package/lib/bundle/stickyFooterAd.js +2 -2
- package/lib/bundle/stickyFooterAds2.js +2 -2
- package/lib/bundle/stickyHeaderAd.js +2 -2
- package/lib/bundle/zeotap.js +2 -2
- package/lib/gen/packageJson.js +1 -1
- package/package.json +1 -1
|
@@ -11,140 +11,141 @@ export const filterHighestNonSkinBid = (bidResponses, blockedAdSlotDomIds) => {
|
|
|
11
11
|
.sort((bid1, bid2) => bid2.cpm - bid1.cpm)
|
|
12
12
|
.slice(0, 1)));
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
export const createSkin = () => {
|
|
15
|
+
const name = 'skin';
|
|
16
|
+
let skinModuleConfig = null;
|
|
17
|
+
let bidsBackHandler = [];
|
|
18
|
+
const config__ = () => skinModuleConfig;
|
|
19
|
+
const getConfigEffect = (config, bidResponses, log) => {
|
|
20
|
+
const skinBidResponse = bidResponses[config.skinAdSlotDomId];
|
|
21
|
+
const isSkinBid = (bid) => {
|
|
22
|
+
const oneFilterApplied = config.formatFilter.some(filter => {
|
|
23
|
+
switch (filter.bidder) {
|
|
24
|
+
case '*':
|
|
25
|
+
return true;
|
|
26
|
+
case 'gumgum':
|
|
27
|
+
return (bid.bidder === prebidjs.GumGum &&
|
|
28
|
+
(filter.auid === undefined ||
|
|
29
|
+
(typeof bid.ad !== 'string' && bid.ad.auid === filter.auid)));
|
|
30
|
+
default:
|
|
31
|
+
return bid.bidder === filter.bidder;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return bid.cpm > 0 && oneFilterApplied;
|
|
35
|
+
};
|
|
36
|
+
const nonSkinBids = filterHighestNonSkinBid(bidResponses, config.blockedAdSlotDomIds);
|
|
37
|
+
const combinedNonSkinCpm = nonSkinBids.reduce((prev, current) => prev + current.cpm, 0);
|
|
38
|
+
const skinBids = skinBidResponse
|
|
39
|
+
?
|
|
40
|
+
skinBidResponse.bids.filter(isSkinBid).sort((bid1, bid2) => bid2.cpm - bid1.cpm)
|
|
41
|
+
: [];
|
|
42
|
+
const skinConfigEffect = skinBids.length > 0
|
|
43
|
+
? skinBids[0].cpm > combinedNonSkinCpm
|
|
41
44
|
?
|
|
42
|
-
|
|
43
|
-
: [];
|
|
44
|
-
const skinConfigEffect = skinBids.length > 0
|
|
45
|
-
? skinBids[0].cpm > combinedNonSkinCpm
|
|
46
|
-
?
|
|
47
|
-
"BlockOtherSlots"
|
|
48
|
-
:
|
|
49
|
-
"BlockSkinSlot"
|
|
45
|
+
"BlockOtherSlots"
|
|
50
46
|
:
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
"BlockSkinSlot"
|
|
48
|
+
:
|
|
49
|
+
"NoBlocking";
|
|
50
|
+
log.debug(name, 'nonSkinBids', nonSkinBids);
|
|
51
|
+
log.debug(name, 'skinBids', skinBids);
|
|
52
|
+
if (config.enableCpmComparison) {
|
|
53
|
+
return skinConfigEffect;
|
|
54
|
+
}
|
|
55
|
+
return skinBids.length > 0 ? "BlockOtherSlots" : "NoBlocking";
|
|
56
|
+
};
|
|
57
|
+
const selectConfig = (skinModuleConfig, bidResponses, log) => skinModuleConfig.configs
|
|
58
|
+
.map(config => ({
|
|
59
|
+
skinConfig: config,
|
|
60
|
+
configEffect: getConfigEffect(config, bidResponses, log)
|
|
61
|
+
}))
|
|
62
|
+
.find(({ configEffect }) => configEffect !== "NoBlocking");
|
|
63
|
+
const destroyAdSlot = (slotDefinitions, gWindow) => (adSlotDomId) => {
|
|
64
|
+
const adSlots = slotDefinitions
|
|
65
|
+
.map(slot => slot.adSlot)
|
|
66
|
+
.filter((slot) => slot.getSlotElementId() === adSlotDomId);
|
|
67
|
+
gWindow.googletag.destroySlots(adSlots);
|
|
68
|
+
};
|
|
69
|
+
const hideAdSlot = (_window, log) => (domId) => {
|
|
70
|
+
const element = _window.document.getElementById(domId);
|
|
71
|
+
try {
|
|
72
|
+
if (element) {
|
|
73
|
+
log.debug('SkinModule', `Set display:none for ${domId}`);
|
|
74
|
+
element.style.setProperty('display', 'none');
|
|
56
75
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.
|
|
68
|
-
.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.runSkinConfigs = (skinModuleConfig) => (ctx, bidResponses, slotDefinitions) => {
|
|
72
|
-
const skinConfigWithEffect = this.selectConfig(skinModuleConfig, bidResponses, ctx.logger__);
|
|
73
|
-
if (skinConfigWithEffect) {
|
|
74
|
-
const { skinConfig, configEffect } = skinConfigWithEffect;
|
|
75
|
-
if (configEffect === "BlockOtherSlots") {
|
|
76
|
-
ctx.logger__.debug('SkinModule', 'Skin configuration applied', skinConfig);
|
|
77
|
-
skinConfig.blockedAdSlotDomIds.forEach(this.destroyAdSlot(slotDefinitions, ctx.window__));
|
|
78
|
-
if (skinConfig.hideBlockedSlots) {
|
|
79
|
-
skinConfig.blockedAdSlotDomIds.forEach(this.hideAdSlot(ctx.window__, ctx.logger__));
|
|
80
|
-
}
|
|
81
|
-
if (skinConfig.hideSkinAdSlot) {
|
|
82
|
-
this.hideAdSlot(ctx.window__, ctx.logger__)(skinConfig.skinAdSlotDomId);
|
|
83
|
-
}
|
|
84
|
-
if (skinConfig.hideBlockedSlotsSelector) {
|
|
85
|
-
ctx.window__.document
|
|
86
|
-
.querySelectorAll(skinConfig.hideBlockedSlotsSelector)
|
|
87
|
-
.forEach(node => {
|
|
88
|
-
ctx.logger__.debug('SkinModule', `Set display:none for container with selector ${skinConfig.hideBlockedSlotsSelector}`);
|
|
89
|
-
node.style.setProperty('display', 'none');
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
if (skinConfig.targeting) {
|
|
93
|
-
try {
|
|
94
|
-
ctx.window__.googletag
|
|
95
|
-
.pubads()
|
|
96
|
-
.setTargeting(skinConfig.targeting.key, skinConfig.targeting.value ?? '1');
|
|
97
|
-
}
|
|
98
|
-
catch (e) {
|
|
99
|
-
ctx.logger__.error('SkinModule', e);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
log.error('SkinModule', `Couldn't set the the wallpaper div ${domId} to display:none;`, e);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const runSkinConfigs = (skinModuleConfig) => (ctx, bidResponses, slotDefinitions) => {
|
|
82
|
+
const skinConfigWithEffect = selectConfig(skinModuleConfig, bidResponses, ctx.logger__);
|
|
83
|
+
if (skinConfigWithEffect) {
|
|
84
|
+
const { skinConfig, configEffect } = skinConfigWithEffect;
|
|
85
|
+
if (configEffect === "BlockOtherSlots") {
|
|
86
|
+
ctx.logger__.debug('SkinModule', 'Skin configuration applied', skinConfig);
|
|
87
|
+
skinConfig.blockedAdSlotDomIds.forEach(destroyAdSlot(slotDefinitions, ctx.window__));
|
|
88
|
+
if (skinConfig.hideBlockedSlots) {
|
|
89
|
+
skinConfig.blockedAdSlotDomIds.forEach(hideAdSlot(ctx.window__, ctx.logger__));
|
|
102
90
|
}
|
|
103
|
-
|
|
104
|
-
ctx.logger__
|
|
105
|
-
this.destroyAdSlot(slotDefinitions, ctx.window__)(skinConfig.skinAdSlotDomId);
|
|
91
|
+
if (skinConfig.hideSkinAdSlot) {
|
|
92
|
+
hideAdSlot(ctx.window__, ctx.logger__)(skinConfig.skinAdSlotDomId);
|
|
106
93
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
94
|
+
if (skinConfig.hideBlockedSlotsSelector) {
|
|
95
|
+
ctx.window__.document
|
|
96
|
+
.querySelectorAll(skinConfig.hideBlockedSlotsSelector)
|
|
97
|
+
.forEach(node => {
|
|
98
|
+
ctx.logger__.debug('SkinModule', `Set display:none for container with selector ${skinConfig.hideBlockedSlotsSelector}`);
|
|
99
|
+
node.style.setProperty('display', 'none');
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (skinConfig.targeting) {
|
|
103
|
+
try {
|
|
104
|
+
ctx.window__.googletag
|
|
105
|
+
.pubads()
|
|
106
|
+
.setTargeting(skinConfig.targeting.key, skinConfig.targeting.value ?? '1');
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
ctx.logger__.error('SkinModule', e);
|
|
110
|
+
}
|
|
122
111
|
}
|
|
123
112
|
}
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
else if (skinConfig.enableCpmComparison) {
|
|
114
|
+
ctx.logger__.debug('SkinModule', 'Skin configuration ignored because cpm was low', skinConfig);
|
|
115
|
+
destroyAdSlot(slotDefinitions, ctx.window__)(skinConfig.skinAdSlotDomId);
|
|
126
116
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
skinModuleConfig.configs
|
|
120
|
+
.filter(skinConfig => skinConfig.destroySkinSlot)
|
|
121
|
+
.map(skinConfig => skinConfig.skinAdSlotDomId)
|
|
122
|
+
.filter(uniquePrimitiveFilter)
|
|
123
|
+
.forEach(destroyAdSlot(slotDefinitions, ctx.window__));
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const configure__ = (moduleConfig) => {
|
|
133
127
|
if (moduleConfig?.skin && moduleConfig.skin.enabled) {
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
skinModuleConfig = moduleConfig.skin;
|
|
129
|
+
bidsBackHandler.push(runSkinConfigs(moduleConfig.skin));
|
|
136
130
|
}
|
|
137
|
-
}
|
|
138
|
-
initSteps__()
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
131
|
+
};
|
|
132
|
+
const initSteps__ = () => [];
|
|
133
|
+
const configureSteps__ = () => [];
|
|
134
|
+
const prepareRequestAdsSteps__ = () => [];
|
|
135
|
+
const prebidBidsBackHandler__ = () => bidsBackHandler;
|
|
136
|
+
return {
|
|
137
|
+
name,
|
|
138
|
+
description: 'Block other ad slots if a wallpaper has won the auction',
|
|
139
|
+
moduleType: 'prebid',
|
|
140
|
+
config__,
|
|
141
|
+
configure__,
|
|
142
|
+
initSteps__,
|
|
143
|
+
configureSteps__,
|
|
144
|
+
prepareRequestAdsSteps__,
|
|
145
|
+
prebidBidsBackHandler__,
|
|
146
|
+
getConfigEffect,
|
|
147
|
+
selectConfig,
|
|
148
|
+
destroyAdSlot,
|
|
149
|
+
runSkinConfigs
|
|
150
|
+
};
|
|
151
|
+
};
|
|
@@ -1,43 +1,20 @@
|
|
|
1
1
|
import { mkInitStep } from 'ad-tag/ads/adPipeline';
|
|
2
2
|
import { AssetLoadMethod } from 'ad-tag/util/assetLoaderService';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.identityLinkConfig = null;
|
|
10
|
-
}
|
|
11
|
-
config__() {
|
|
12
|
-
return this.identityLinkConfig;
|
|
13
|
-
}
|
|
14
|
-
configure__(moduleConfig) {
|
|
3
|
+
export const createIdentityLink = () => {
|
|
4
|
+
const name = 'identitylink';
|
|
5
|
+
const gvlid = '97';
|
|
6
|
+
let identityLinkConfig = null;
|
|
7
|
+
const config__ = () => identityLinkConfig;
|
|
8
|
+
const configure__ = (moduleConfig) => {
|
|
15
9
|
if (moduleConfig?.identitylink && moduleConfig.identitylink.enabled) {
|
|
16
|
-
|
|
10
|
+
identityLinkConfig = moduleConfig.identitylink;
|
|
17
11
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const config = this.identityLinkConfig;
|
|
21
|
-
return config
|
|
22
|
-
? [
|
|
23
|
-
mkInitStep(this.name, ctx => {
|
|
24
|
-
this.loadAts(ctx, config);
|
|
25
|
-
return Promise.resolve();
|
|
26
|
-
})
|
|
27
|
-
]
|
|
28
|
-
: [];
|
|
29
|
-
}
|
|
30
|
-
configureSteps__() {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
prepareRequestAdsSteps__() {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
loadAts(context, moduleConfig) {
|
|
12
|
+
};
|
|
13
|
+
const loadAts = (context, moduleConfig) => {
|
|
37
14
|
if (context.env__ === 'test') {
|
|
38
15
|
return Promise.resolve();
|
|
39
16
|
}
|
|
40
|
-
if (context.tcData__.gdprApplies && !context.tcData__.vendor.consents[
|
|
17
|
+
if (context.tcData__.gdprApplies && !context.tcData__.vendor.consents[gvlid]) {
|
|
41
18
|
return Promise.resolve();
|
|
42
19
|
}
|
|
43
20
|
const window = context.window__;
|
|
@@ -62,10 +39,34 @@ export class IdentityLink {
|
|
|
62
39
|
});
|
|
63
40
|
return context.assetLoaderService__
|
|
64
41
|
.loadScript({
|
|
65
|
-
name
|
|
42
|
+
name,
|
|
66
43
|
loadMethod: AssetLoadMethod.TAG,
|
|
67
44
|
assetUrl: `https://launchpad-wrapper.privacymanager.io/${moduleConfig.launchPadId}/launchpad-liveramp.js`
|
|
68
45
|
})
|
|
69
46
|
.catch(error => context.logger__.error('failed to load emetriq', error));
|
|
70
|
-
}
|
|
71
|
-
|
|
47
|
+
};
|
|
48
|
+
const initSteps__ = () => {
|
|
49
|
+
const config = identityLinkConfig;
|
|
50
|
+
return config
|
|
51
|
+
? [
|
|
52
|
+
mkInitStep(name, ctx => {
|
|
53
|
+
loadAts(ctx, config);
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
: [];
|
|
58
|
+
};
|
|
59
|
+
const configureSteps__ = () => [];
|
|
60
|
+
const prepareRequestAdsSteps__ = () => [];
|
|
61
|
+
return {
|
|
62
|
+
name,
|
|
63
|
+
description: "Provides LiveRamp's ATS (authenticated traffic solution) functionality to Moli.",
|
|
64
|
+
moduleType: 'identity',
|
|
65
|
+
config__,
|
|
66
|
+
configure__,
|
|
67
|
+
initSteps__,
|
|
68
|
+
configureSteps__,
|
|
69
|
+
prepareRequestAdsSteps__,
|
|
70
|
+
loadAts
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -2,35 +2,21 @@ import { mkConfigureStep } from 'ad-tag/ads/adPipeline';
|
|
|
2
2
|
import { uniquePrimitiveFilter } from 'ad-tag/util/arrayUtils';
|
|
3
3
|
import { mergeDeep } from 'ad-tag/util/objectUtils';
|
|
4
4
|
import { extractTopPrivateDomainFromHostname } from 'ad-tag/util/extractTopPrivateDomainFromHostname';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (moduleConfig?.prebidFirstPartyData?.enabled) {
|
|
18
|
-
const config = moduleConfig.prebidFirstPartyData;
|
|
19
|
-
this._configureSteps = [
|
|
20
|
-
mkConfigureStep('prebid-fpd-module-configure', context => PrebidFirstPartyDataModule.setPrebidFpdConfig(context, config, context.logger__))
|
|
21
|
-
];
|
|
5
|
+
export const createPrebidFirstPartyDataModule = () => {
|
|
6
|
+
const name = 'prebid-first-party-data';
|
|
7
|
+
let moduleConfig = null;
|
|
8
|
+
let configureStepsArr = [];
|
|
9
|
+
const config__ = () => moduleConfig;
|
|
10
|
+
const extractKeyValueArray = (key, keyValues) => {
|
|
11
|
+
const value = keyValues[key];
|
|
12
|
+
if (value) {
|
|
13
|
+
return typeof value === 'string' ? [value] : value;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return [];
|
|
22
17
|
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
configureSteps__() {
|
|
28
|
-
return this._configureSteps;
|
|
29
|
-
}
|
|
30
|
-
prepareRequestAdsSteps__() {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
static setPrebidFpdConfig(context, config, log) {
|
|
18
|
+
};
|
|
19
|
+
const setPrebidFpdConfig = (context, config, log) => {
|
|
34
20
|
if (context.config__.prebid) {
|
|
35
21
|
const keyValues = context.config__.targeting?.keyValues || {};
|
|
36
22
|
const gptTargeting = config.gptTargetingMappings;
|
|
@@ -45,16 +31,16 @@ export class PrebidFirstPartyDataModule {
|
|
|
45
31
|
...ortb2FromKeyValues.site
|
|
46
32
|
};
|
|
47
33
|
if (gptTargeting.cat) {
|
|
48
|
-
const keyValueData =
|
|
34
|
+
const keyValueData = extractKeyValueArray(gptTargeting.cat, keyValues);
|
|
49
35
|
site.cat?.push(...keyValueData);
|
|
50
36
|
site.pagecat?.push(...keyValueData);
|
|
51
37
|
site.sectioncat?.push(...keyValueData);
|
|
52
38
|
}
|
|
53
39
|
if (gptTargeting.sectionCat) {
|
|
54
|
-
site.sectioncat =
|
|
40
|
+
site.sectioncat = extractKeyValueArray(gptTargeting.sectionCat, keyValues);
|
|
55
41
|
}
|
|
56
42
|
if (gptTargeting.pageCat) {
|
|
57
|
-
site.pagecat =
|
|
43
|
+
site.pagecat = extractKeyValueArray(gptTargeting.pageCat, keyValues);
|
|
58
44
|
}
|
|
59
45
|
if (site.cat) {
|
|
60
46
|
site.cat = site.cat.filter(uniquePrimitiveFilter);
|
|
@@ -75,7 +61,7 @@ export class PrebidFirstPartyDataModule {
|
|
|
75
61
|
data: site.content?.data?.filter(data => data.name !== provider) ?? []
|
|
76
62
|
};
|
|
77
63
|
if (gptTargeting.iabV2 && provider) {
|
|
78
|
-
const iabV2Ids =
|
|
64
|
+
const iabV2Ids = extractKeyValueArray(gptTargeting.iabV2, keyValues);
|
|
79
65
|
const publisherContentData = {
|
|
80
66
|
name: provider,
|
|
81
67
|
ext: {
|
|
@@ -86,7 +72,7 @@ export class PrebidFirstPartyDataModule {
|
|
|
86
72
|
site.content.data?.push(publisherContentData);
|
|
87
73
|
}
|
|
88
74
|
if (gptTargeting.iabV3 && provider) {
|
|
89
|
-
const iabV3Ids =
|
|
75
|
+
const iabV3Ids = extractKeyValueArray(gptTargeting.iabV3, keyValues);
|
|
90
76
|
const publisherContentData = {
|
|
91
77
|
name: provider,
|
|
92
78
|
ext: {
|
|
@@ -102,14 +88,26 @@ export class PrebidFirstPartyDataModule {
|
|
|
102
88
|
});
|
|
103
89
|
}
|
|
104
90
|
return Promise.resolve();
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return [];
|
|
91
|
+
};
|
|
92
|
+
const configure__ = (mConfig) => {
|
|
93
|
+
if (mConfig?.prebidFirstPartyData?.enabled) {
|
|
94
|
+
const config = mConfig.prebidFirstPartyData;
|
|
95
|
+
configureStepsArr = [
|
|
96
|
+
mkConfigureStep('prebid-fpd-module-configure', context => setPrebidFpdConfig(context, config, context.logger__))
|
|
97
|
+
];
|
|
113
98
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
99
|
+
};
|
|
100
|
+
const initSteps__ = () => [];
|
|
101
|
+
const configureSteps__ = () => configureStepsArr;
|
|
102
|
+
const prepareRequestAdsSteps__ = () => [];
|
|
103
|
+
return {
|
|
104
|
+
name,
|
|
105
|
+
description: 'Module for passing first party data to prebid auctions',
|
|
106
|
+
moduleType: 'prebid',
|
|
107
|
+
config__,
|
|
108
|
+
configure__,
|
|
109
|
+
initSteps__,
|
|
110
|
+
configureSteps__,
|
|
111
|
+
prepareRequestAdsSteps__
|
|
112
|
+
};
|
|
113
|
+
};
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { AssetLoadMethod } from 'ad-tag/util/assetLoaderService';
|
|
2
2
|
import { mkConfigureStep, mkInitStep } from '../../adPipeline';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.pubstackConfig = null;
|
|
9
|
-
}
|
|
10
|
-
config__() {
|
|
11
|
-
return this.pubstackConfig;
|
|
12
|
-
}
|
|
13
|
-
configure__(moduleConfig) {
|
|
3
|
+
export const createPubstack = () => {
|
|
4
|
+
const name = 'pubstack';
|
|
5
|
+
let pubstackConfig = null;
|
|
6
|
+
const config__ = () => pubstackConfig;
|
|
7
|
+
const configure__ = (moduleConfig) => {
|
|
14
8
|
if (moduleConfig?.pubstack && moduleConfig.pubstack.enabled) {
|
|
15
|
-
|
|
9
|
+
pubstackConfig = moduleConfig.pubstack;
|
|
16
10
|
}
|
|
17
|
-
}
|
|
18
|
-
initSteps__() {
|
|
19
|
-
const config =
|
|
11
|
+
};
|
|
12
|
+
const initSteps__ = () => {
|
|
13
|
+
const config = pubstackConfig;
|
|
20
14
|
return config
|
|
21
15
|
? [
|
|
22
16
|
mkInitStep('pubstack-init', ctx => {
|
|
@@ -25,7 +19,7 @@ export class Pubstack {
|
|
|
25
19
|
}
|
|
26
20
|
ctx.assetLoaderService__
|
|
27
21
|
.loadScript({
|
|
28
|
-
name
|
|
22
|
+
name,
|
|
29
23
|
loadMethod: AssetLoadMethod.TAG,
|
|
30
24
|
assetUrl: `https://boot.pbstck.com/v1/tag/${config.tagId}`
|
|
31
25
|
})
|
|
@@ -34,9 +28,9 @@ export class Pubstack {
|
|
|
34
28
|
})
|
|
35
29
|
]
|
|
36
30
|
: [];
|
|
37
|
-
}
|
|
38
|
-
configureSteps__() {
|
|
39
|
-
const config =
|
|
31
|
+
};
|
|
32
|
+
const configureSteps__ = () => {
|
|
33
|
+
const config = pubstackConfig;
|
|
40
34
|
return config
|
|
41
35
|
? [
|
|
42
36
|
mkConfigureStep('pubstack-configure', ctx => {
|
|
@@ -52,8 +46,16 @@ export class Pubstack {
|
|
|
52
46
|
})
|
|
53
47
|
]
|
|
54
48
|
: [];
|
|
55
|
-
}
|
|
56
|
-
prepareRequestAdsSteps__()
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
};
|
|
50
|
+
const prepareRequestAdsSteps__ = () => [];
|
|
51
|
+
return {
|
|
52
|
+
name,
|
|
53
|
+
description: 'prebid analytics integration',
|
|
54
|
+
moduleType: 'reporting',
|
|
55
|
+
config__,
|
|
56
|
+
configure__,
|
|
57
|
+
initSteps__,
|
|
58
|
+
configureSteps__,
|
|
59
|
+
prepareRequestAdsSteps__
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
import { LOW_PRIORITY, mkPrepareRequestAdsStep } from 'ad-tag/ads/adPipeline';
|
|
2
2
|
import { setupFooterAdListener } from './desktopFloorAd';
|
|
3
3
|
import { initMobileAdSticky } from './mobileSticky';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.stickyFooterAdConfig = null;
|
|
10
|
-
}
|
|
11
|
-
config__() {
|
|
12
|
-
return this.stickyFooterAdConfig;
|
|
13
|
-
}
|
|
14
|
-
configure__(moduleConfig) {
|
|
4
|
+
export const createStickyFooterAd = () => {
|
|
5
|
+
const name = 'sticky-footer-ads';
|
|
6
|
+
let stickyFooterAdConfig = null;
|
|
7
|
+
const config__ = () => stickyFooterAdConfig;
|
|
8
|
+
const configure__ = (moduleConfig) => {
|
|
15
9
|
if (moduleConfig?.stickyFooterAd?.enabled) {
|
|
16
|
-
|
|
10
|
+
stickyFooterAdConfig = moduleConfig.stickyFooterAd;
|
|
17
11
|
}
|
|
18
|
-
}
|
|
19
|
-
prepareRequestAdsSteps__() {
|
|
20
|
-
const config =
|
|
12
|
+
};
|
|
13
|
+
const prepareRequestAdsSteps__ = () => {
|
|
14
|
+
const config = stickyFooterAdConfig;
|
|
21
15
|
return config
|
|
22
16
|
? [
|
|
23
|
-
mkPrepareRequestAdsStep(
|
|
17
|
+
mkPrepareRequestAdsStep(name, LOW_PRIORITY, (ctx, slots) => {
|
|
24
18
|
if (config.mobileStickyDomId &&
|
|
25
|
-
slots.some(slot => slot.moliSlot.domId ===
|
|
19
|
+
slots.some(slot => slot.moliSlot.domId === config.mobileStickyDomId)) {
|
|
26
20
|
initMobileAdSticky(ctx.window__, ctx.env__, ctx.logger__, config.mobileStickyDomId, config.disallowedAdvertiserIds, config.initiallyHidden ?? false);
|
|
27
21
|
}
|
|
28
22
|
if (config.desktopFloorAdDomId &&
|
|
@@ -33,11 +27,17 @@ export class StickyFooterAd {
|
|
|
33
27
|
})
|
|
34
28
|
]
|
|
35
29
|
: [];
|
|
36
|
-
}
|
|
37
|
-
configureSteps__()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
};
|
|
31
|
+
const configureSteps__ = () => [];
|
|
32
|
+
const initSteps__ = () => [];
|
|
33
|
+
return {
|
|
34
|
+
name,
|
|
35
|
+
description: 'sticky footer ad creatives',
|
|
36
|
+
moduleType: 'creatives',
|
|
37
|
+
config__,
|
|
38
|
+
configure__,
|
|
39
|
+
prepareRequestAdsSteps__,
|
|
40
|
+
configureSteps__,
|
|
41
|
+
initSteps__
|
|
42
|
+
};
|
|
43
|
+
};
|