@highfivve/ad-tag 5.7.1 → 5.7.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 +1 -2
- package/lib/ads/isAdvertiserIncluded.js +5 -0
- package/lib/ads/modules/ad-reload/adVisibilityService.js +2 -4
- package/lib/ads/modules/ad-reload/index.js +2 -2
- package/lib/ads/modules/interstitial/interstitialAd.js +2 -5
- package/lib/ads/modules/sticky-footer-ad/desktopFloorAd.js +2 -2
- package/lib/ads/modules/sticky-footer-ad/mobileSticky.js +2 -5
- package/lib/ads/modules/sticky-footer-ad-v2/footerStickyAd.js +2 -5
- package/lib/ads/modules/sticky-header-ad/renderResult.js +2 -5
- package/lib/gen/packageJson.js +1 -1
- package/package.json +1 -1
|
@@ -305,9 +305,8 @@ export const gptDefineSlots = () => (context, slots) => {
|
|
|
305
305
|
if (adSlot) {
|
|
306
306
|
if (moliSlot.gpt) {
|
|
307
307
|
adSlot.setConfig(moliSlot.gpt);
|
|
308
|
-
context.logger__.debug('GAM', `Add slot settings: [AdSlot] ${adSlot}
|
|
308
|
+
context.logger__.debug('GAM', `Add slot settings: [AdSlot] ${adSlot.getSlotElementId()}`, moliSlot.gpt);
|
|
309
309
|
}
|
|
310
|
-
adSlot.setCollapseEmptyDiv(moliSlot.gpt?.collapseEmptyDiv !== false);
|
|
311
310
|
adSlot.addService(context.window__.googletag.pubads());
|
|
312
311
|
context.logger__.debug('GAM', `Register slot: [DomID] ${moliSlot.domId} [AdUnitPath] ${moliSlot.adUnitPath}`);
|
|
313
312
|
return Promise.resolve({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
1
2
|
export class AdVisibilityService {
|
|
2
3
|
constructor(userActivityService, refreshInterval, refreshIntervalOverrides, useIntersectionObserver, disableAdVisibilityChecks, viewabilityOverrides, window, logger) {
|
|
3
4
|
this.userActivityService = userActivityService;
|
|
@@ -76,10 +77,7 @@ export class AdVisibilityService {
|
|
|
76
77
|
(override.disableAllAdVisibilityChecks ||
|
|
77
78
|
!(override.disabledAdVisibilityCheckAdvertiserIds &&
|
|
78
79
|
override.disabledAdVisibilityCheckAdvertiserIds.length > 0) ||
|
|
79
|
-
(advertiserId
|
|
80
|
-
override.disabledAdVisibilityCheckAdvertiserIds.includes(advertiserId)) ||
|
|
81
|
-
(companyIds &&
|
|
82
|
-
override.disabledAdVisibilityCheckAdvertiserIds.some(id => companyIds.includes(id)))))
|
|
80
|
+
isAdvertiserIncluded({ advertiserId, companyIds }, override.disabledAdVisibilityCheckAdvertiserIds)))
|
|
83
81
|
? this.window.performance.now()
|
|
84
82
|
: undefined,
|
|
85
83
|
durationVisibleSum: 0,
|
|
@@ -2,6 +2,7 @@ import { AdVisibilityService } from './adVisibilityService';
|
|
|
2
2
|
import { UserActivityService } from './userActivityService';
|
|
3
3
|
import { mkConfigureStep } from '../../adPipeline';
|
|
4
4
|
import { isNotNull } from 'ad-tag/util/arrayUtils';
|
|
5
|
+
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
5
6
|
export class AdReload {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.name = 'moli-ad-reload';
|
|
@@ -33,8 +34,7 @@ export class AdReload {
|
|
|
33
34
|
const slotIsMonitored = slotsToMonitor.indexOf(slotDomId) > -1;
|
|
34
35
|
const orderIdNotExcluded = !campaignId || config.excludeOrderIds.indexOf(campaignId) === -1;
|
|
35
36
|
const orderIdIncluded = !!campaignId && config.includeOrderIds.indexOf(campaignId) > -1;
|
|
36
|
-
const advertiserIdIncluded = (
|
|
37
|
-
(!!companyIds && config.includeAdvertiserIds.some(id => companyIds.includes(id)));
|
|
37
|
+
const advertiserIdIncluded = isAdvertiserIncluded(renderEndedEvent, config.includeAdvertiserIds);
|
|
38
38
|
const yieldGroupIdIncluded = !!yieldGroupIds && config.includeYieldGroupIds.some(id => yieldGroupIds.indexOf(id) > -1);
|
|
39
39
|
const trackingSlotAllowed = !slotIsEmpty &&
|
|
40
40
|
slotIsMonitored &&
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getBrowserStorageValue } from 'ad-tag/util/localStorage';
|
|
2
2
|
import { isGamInterstitial } from 'ad-tag/ads/auctions/interstitialContext';
|
|
3
|
+
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
3
4
|
const interstitialContainerSelector = '[data-ref="h5v-interstitial"]';
|
|
4
5
|
const interstitialCloseButtonSelector = '[data-ref="h5v-interstitial-close"]';
|
|
5
6
|
const interstitialHidingClass = 'h5v-interstitial--hidden';
|
|
@@ -11,11 +12,7 @@ const interstitialRenderedEvent = (interstitialDomId, disallowedAdvertiserIds, w
|
|
|
11
12
|
if (event.isEmpty) {
|
|
12
13
|
resolve({ result: 'empty', slot: event.slot });
|
|
13
14
|
}
|
|
14
|
-
else if (event
|
|
15
|
-
resolve({ result: 'disallowed', slot: event.slot });
|
|
16
|
-
}
|
|
17
|
-
else if (event.companyIds &&
|
|
18
|
-
disallowedAdvertiserIds.some(id => event.companyIds?.includes(id))) {
|
|
15
|
+
else if (isAdvertiserIncluded(event, disallowedAdvertiserIds)) {
|
|
19
16
|
resolve({ result: 'disallowed', slot: event.slot });
|
|
20
17
|
}
|
|
21
18
|
else {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
1
2
|
const closeButtonDataRef = 'footer-ad-close-button';
|
|
2
3
|
const containerDataRefSelector = '[data-ref=h5-footer-ad-container]';
|
|
3
4
|
const closeButtonDataRefSelector = `[data-ref=${closeButtonDataRef}]`;
|
|
@@ -21,8 +22,7 @@ const renderFooterAd = (window, floorAdDomId, disallowedAdvertiserIds, log) => (
|
|
|
21
22
|
!footerAdElement ||
|
|
22
23
|
slot.getSlotElementId() !== floorAdDomId ||
|
|
23
24
|
event.isEmpty ||
|
|
24
|
-
(
|
|
25
|
-
(!!event.companyIds && disallowedAdvertiserIds.some(id => event.companyIds?.includes(id))) ||
|
|
25
|
+
isAdvertiserIncluded(event, disallowedAdvertiserIds) ||
|
|
26
26
|
window.matchMedia('(max-width: 767px)').matches) {
|
|
27
27
|
log.debug('[footer-ad]', 'remove footer ad container');
|
|
28
28
|
return;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
1
2
|
const adStickyContainerDataRef = '[data-ref=sticky-ad]';
|
|
2
3
|
const adStickyCloseButtonDataRef = '[data-ref=sticky-ad-close]';
|
|
3
4
|
const adVisibleClass = 'h5-sticky-ad--visible';
|
|
@@ -20,11 +21,7 @@ const stickyRenderedEvent = (adSticky, mobileStickyDomId, disallowedAdvertiserId
|
|
|
20
21
|
}
|
|
21
22
|
resolve('empty');
|
|
22
23
|
}
|
|
23
|
-
else if (
|
|
24
|
-
resolve('disallowed');
|
|
25
|
-
}
|
|
26
|
-
else if (!!event.companyIds &&
|
|
27
|
-
disallowedAdvertiserIds.some(id => event.companyIds?.includes(id))) {
|
|
24
|
+
else if (isAdvertiserIncluded(event, disallowedAdvertiserIds)) {
|
|
28
25
|
resolve('disallowed');
|
|
29
26
|
}
|
|
30
27
|
else {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
1
2
|
const adStickyContainerDataRef = '[data-ref=h5v-sticky-ad]';
|
|
2
3
|
const adStickyCloseButtonDataRef = '[data-ref=h5v-sticky-ad-close]';
|
|
3
4
|
const adStickyCloseButtonContent = '.h5v-closeButtonContent';
|
|
@@ -12,11 +13,7 @@ const stickyRenderedEvent = (mobileStickyDomId, disallowedAdvertiserIds, window)
|
|
|
12
13
|
if (event.isEmpty) {
|
|
13
14
|
resolve('empty');
|
|
14
15
|
}
|
|
15
|
-
else if (event
|
|
16
|
-
resolve('disallowed');
|
|
17
|
-
}
|
|
18
|
-
else if (!!event.companyIds &&
|
|
19
|
-
disallowedAdvertiserIds.some(id => event.companyIds?.includes(id))) {
|
|
16
|
+
else if (isAdvertiserIncluded(event, disallowedAdvertiserIds)) {
|
|
20
17
|
resolve('disallowed');
|
|
21
18
|
}
|
|
22
19
|
else {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
1
2
|
export const adRenderResult = (ctx, headerSlot, disallowedAdvertiserIds, minVisibleDuration) => new Promise(resolve => {
|
|
2
3
|
if (ctx.env__ === 'test') {
|
|
3
4
|
resolve('standard');
|
|
@@ -7,11 +8,7 @@ export const adRenderResult = (ctx, headerSlot, disallowedAdvertiserIds, minVisi
|
|
|
7
8
|
if (event.slot.getSlotElementId() !== headerSlot.domId) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
|
-
if (event
|
|
11
|
-
resolve('disallowed');
|
|
12
|
-
}
|
|
13
|
-
else if (event.companyIds &&
|
|
14
|
-
disallowedAdvertiserIds.some(id => event.companyIds?.includes(id))) {
|
|
11
|
+
if (isAdvertiserIncluded(event, disallowedAdvertiserIds)) {
|
|
15
12
|
resolve('disallowed');
|
|
16
13
|
}
|
|
17
14
|
else if (event.isEmpty) {
|
package/lib/gen/packageJson.js
CHANGED