@highfivve/ad-tag 5.13.0 → 5.13.2
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/googleAdManager.js +10 -3
- package/lib/gen/packageJson.js +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { AssetLoadMethod } from '../util/assetLoaderService';
|
|
|
5
5
|
import { tcfapi } from '../types/tcfapi';
|
|
6
6
|
import { createTestSlots } from '../util/test-slots';
|
|
7
7
|
import { resolveAdUnitPath } from './adUnitPath';
|
|
8
|
+
import { findGoogletagSlot } from './findGoogletagSlot';
|
|
8
9
|
import { formatKey, CUSTOM_INTERSTITIAL_FORMAT, CUSTOM_ANCHOR_BOTTOM_FORMAT, CUSTOM_ANCHOR_TOP_FORMAT } from './keyValues';
|
|
9
10
|
const testAdSlot = (domId, adUnitPath) => ({
|
|
10
11
|
setCollapseEmptyDiv() {
|
|
@@ -124,17 +125,23 @@ export const gptDestroyAdSlots = () => {
|
|
|
124
125
|
}
|
|
125
126
|
return Promise.resolve();
|
|
126
127
|
case 'requested':
|
|
127
|
-
const allGptSlots = context.window__.googletag.pubads().getSlots();
|
|
128
128
|
const gptSlots = slots
|
|
129
|
-
.map(slot =>
|
|
129
|
+
.map(slot => findGoogletagSlot({
|
|
130
|
+
domId: slot.domId,
|
|
131
|
+
adUnitPath: resolveAdUnitPath(slot.adUnitPath, context.adUnitPathVariables__)
|
|
132
|
+
}, context.window__.googletag))
|
|
130
133
|
.filter(isNotNull);
|
|
131
134
|
return destroySelectedSlots(gptSlots);
|
|
132
135
|
case 'excluded':
|
|
133
136
|
if (isNextRequestAdsCall) {
|
|
137
|
+
const excludedAdUnitPaths = context.config__.slots
|
|
138
|
+
.filter(moliSlot => cleanup.slotIds.includes(moliSlot.domId))
|
|
139
|
+
.map(moliSlot => resolveAdUnitPath(moliSlot.adUnitPath, context.adUnitPathVariables__));
|
|
134
140
|
const destroyableSlots = context.window__.googletag
|
|
135
141
|
.pubads()
|
|
136
142
|
.getSlots()
|
|
137
|
-
.filter(slot => !cleanup.slotIds.includes(slot.getSlotElementId())
|
|
143
|
+
.filter(slot => !cleanup.slotIds.includes(slot.getSlotElementId()) &&
|
|
144
|
+
!excludedAdUnitPaths.includes(slot.getAdUnitPath()));
|
|
138
145
|
return destroySelectedSlots(destroyableSlots);
|
|
139
146
|
}
|
|
140
147
|
return Promise.resolve();
|
package/lib/gen/packageJson.js
CHANGED