@highfivve/ad-tag 5.6.0 → 5.6.3
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/a9.js
CHANGED
|
@@ -137,7 +137,7 @@ const resolveAdUnitPath = (path, slotDepth, variables) => {
|
|
|
137
137
|
return adUnitPath.resolveAdUnitPath(truncated, variables);
|
|
138
138
|
};
|
|
139
139
|
export const a9RequestBids = (config) => mkRequestBidsStep('a9-fetch-bids', (context, slotDefinitions) => new Promise(resolve => {
|
|
140
|
-
if (!hasRequiredConsent(context.tcData__)) {
|
|
140
|
+
if (!hasRequiredConsent(context.tcData__) || config.enabled === false) {
|
|
141
141
|
context.logger__.debug('A9', 'Skip any due to missing consent');
|
|
142
142
|
resolve();
|
|
143
143
|
return;
|
package/lib/ads/adService.js
CHANGED
|
@@ -93,7 +93,7 @@ export class AdService {
|
|
|
93
93
|
prepareRequestAds.push(prebidPrepareRequestAds(config.prebid));
|
|
94
94
|
requestBids.push(prebidRequestBids(config.prebid, adServer));
|
|
95
95
|
}
|
|
96
|
-
if (config.a9 && env === 'production' && isGam) {
|
|
96
|
+
if (config.a9 && config.a9.enabled !== false && env === 'production' && isGam) {
|
|
97
97
|
init.push(a9Init(config.a9, this.assetService));
|
|
98
98
|
configure.push(a9Configure(config.a9, config.schain));
|
|
99
99
|
configure.push(a9PublisherAudiences(config.a9));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getBrowserStorageValue } from 'ad-tag/util/localStorage';
|
|
2
|
+
import { isGamInterstitial } from 'ad-tag/ads/auctions/interstitialContext';
|
|
2
3
|
const interstitialContainerSelector = '[data-ref="h5v-interstitial"]';
|
|
3
4
|
const interstitialCloseButtonSelector = '[data-ref="h5v-interstitial-close"]';
|
|
4
5
|
const interstitialHidingClass = 'h5v-interstitial--hidden';
|
|
@@ -8,14 +9,14 @@ const interstitialRenderedEvent = (interstitialDomId, disallowedAdvertiserIds, w
|
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
11
|
if (event.isEmpty) {
|
|
11
|
-
resolve('empty');
|
|
12
|
+
resolve({ result: 'empty', slot: event.slot });
|
|
12
13
|
}
|
|
13
14
|
else if (event.advertiserId && disallowedAdvertiserIds.includes(event.advertiserId)) {
|
|
14
|
-
resolve('disallowed');
|
|
15
|
+
resolve({ result: 'disallowed', slot: event.slot });
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
event.slot.setConfig({ safeFrame: { forceSafeFrame: true } });
|
|
18
|
-
resolve('standard');
|
|
19
|
+
resolve({ result: 'standard', slot: event.slot });
|
|
19
20
|
}
|
|
20
21
|
window.googletag.pubads().removeEventListener('slotRenderEnded', listener);
|
|
21
22
|
};
|
|
@@ -60,14 +61,16 @@ export const initInterstitialModule = (window, env, log, interstitialDomId, disa
|
|
|
60
61
|
closeButton.addEventListener('click', () => {
|
|
61
62
|
closeInterstitial();
|
|
62
63
|
});
|
|
63
|
-
const onRenderResult = (
|
|
64
|
-
log.debug(interstitial, `result ${
|
|
65
|
-
if (
|
|
64
|
+
const onRenderResult = ({ result, slot }) => {
|
|
65
|
+
log.debug(interstitial, `result ${result}`);
|
|
66
|
+
if (result === 'disallowed' ||
|
|
67
|
+
result === 'empty' ||
|
|
68
|
+
(slot && isGamInterstitial(slot, window))) {
|
|
66
69
|
log.debug(interstitial, 'hide interstitial container');
|
|
67
70
|
hideAdSlot(interstitialAdContainer);
|
|
68
71
|
return Promise.resolve();
|
|
69
72
|
}
|
|
70
|
-
else if (
|
|
73
|
+
else if (result === 'standard') {
|
|
71
74
|
showAdSlot(interstitialAdContainer);
|
|
72
75
|
if (closeAutomaticallyAfterMs) {
|
|
73
76
|
timeoutToBeClearedWhenModuleIsInitialized = window.setTimeout(() => {
|
|
@@ -76,9 +79,9 @@ export const initInterstitialModule = (window, env, log, interstitialDomId, disa
|
|
|
76
79
|
}
|
|
77
80
|
const interstitialOnLoadEventPromise = interstitialOnLoadEvent(interstitialDomId, window);
|
|
78
81
|
return interstitialRenderedEvent(interstitialDomId, disallowedAdvertiserIds, window)
|
|
79
|
-
.then(
|
|
80
|
-
? Promise.resolve(
|
|
81
|
-
: interstitialOnLoadEventPromise.then(() =>
|
|
82
|
+
.then(renderResult => renderResult.result === 'empty' || renderResult.result === 'disallowed'
|
|
83
|
+
? Promise.resolve(renderResult)
|
|
84
|
+
: interstitialOnLoadEventPromise.then(() => renderResult))
|
|
82
85
|
.then(onRenderResult);
|
|
83
86
|
}
|
|
84
87
|
return Promise.resolve();
|
|
@@ -87,17 +90,17 @@ export const initInterstitialModule = (window, env, log, interstitialDomId, disa
|
|
|
87
90
|
case 'production':
|
|
88
91
|
const interstitialOnLoadEventPromise = interstitialOnLoadEvent(interstitialDomId, window);
|
|
89
92
|
interstitialRenderedEvent(interstitialDomId, disallowedAdvertiserIds, window)
|
|
90
|
-
.then(
|
|
91
|
-
? Promise.resolve(
|
|
92
|
-
: interstitialOnLoadEventPromise.then(() =>
|
|
93
|
+
.then(renderResult => renderResult.result === 'empty' || renderResult.result === 'disallowed'
|
|
94
|
+
? Promise.resolve(renderResult)
|
|
95
|
+
: interstitialOnLoadEventPromise.then(() => renderResult))
|
|
93
96
|
.then(onRenderResult);
|
|
94
97
|
break;
|
|
95
98
|
case 'test':
|
|
96
99
|
if (!!getBrowserStorageValue('test-interstitial', localStorage)) {
|
|
97
|
-
onRenderResult('standard');
|
|
100
|
+
onRenderResult({ result: 'standard', slot: null });
|
|
98
101
|
}
|
|
99
102
|
else {
|
|
100
|
-
onRenderResult('empty');
|
|
103
|
+
onRenderResult({ result: 'empty', slot: null });
|
|
101
104
|
}
|
|
102
105
|
break;
|
|
103
106
|
default:
|
package/lib/gen/packageJson.js
CHANGED
package/lib/types/prebidjs.js
CHANGED
|
@@ -10,6 +10,7 @@ export var prebidjs;
|
|
|
10
10
|
prebidjs.AppNexusAst = 'appnexusAst';
|
|
11
11
|
prebidjs.AppNexus = 'appnexus';
|
|
12
12
|
prebidjs.GumGum = 'gumgum';
|
|
13
|
+
prebidjs.Equativ = 'equativ';
|
|
13
14
|
prebidjs.ImproveDigital = 'improvedigital';
|
|
14
15
|
prebidjs.IndexExchange = 'ix';
|
|
15
16
|
prebidjs.InMobi = 'inmobi';
|