@highfivve/ad-tag 5.8.5 → 5.8.7

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.
@@ -5,7 +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 { formatKey } from './keyValues';
8
+ import { formatKey, CUSTOM_INTERSTITIAL_FORMAT } from './keyValues';
9
9
  const testAdSlot = (domId, adUnitPath) => ({
10
10
  setCollapseEmptyDiv() {
11
11
  return;
@@ -288,6 +288,11 @@ export const gptDefineSlots = () => (context, slots) => {
288
288
  if (format) {
289
289
  adSlot.setTargeting(formatKey, format.toString());
290
290
  }
291
+ else if (moliSlot.position === 'interstitial') {
292
+ if (context.auction__.interstitialChannel() === 'c') {
293
+ adSlot.setTargeting(formatKey, CUSTOM_INTERSTITIAL_FORMAT);
294
+ }
295
+ }
291
296
  else {
292
297
  adSlot.clearTargeting(formatKey);
293
298
  }
@@ -1 +1,2 @@
1
1
  export const formatKey = 'f';
2
+ export const CUSTOM_INTERSTITIAL_FORMAT = '100';
@@ -1,5 +1,15 @@
1
1
  import { mkInitStep } from 'ad-tag/ads/adPipeline';
2
2
  const name = 'custom';
3
+ const hasConsent = (context, scriptConfig) => {
4
+ if (context.env__ === 'test' || !scriptConfig.consent) {
5
+ return true;
6
+ }
7
+ switch (scriptConfig.consent.cmpApi) {
8
+ case 'tcf':
9
+ return (!context.tcData__.gdprApplies ||
10
+ context.tcData__.vendor.consents[scriptConfig.consent.vendorId]);
11
+ }
12
+ };
3
13
  export const customModule = () => {
4
14
  let customConfig = null;
5
15
  const injectInlineJs = (context, config) => {
@@ -17,7 +27,8 @@ export const customModule = () => {
17
27
  }
18
28
  if (config.scripts) {
19
29
  config.scripts
20
- .filter(scriptConfig => context.labelConfigService__.filterSlot(scriptConfig))
30
+ .filter(scriptConfig => context.labelConfigService__.filterSlot(scriptConfig) &&
31
+ hasConsent(context, scriptConfig))
21
32
  .forEach(scriptConfig => {
22
33
  try {
23
34
  const script = context.window__.document.createElement('script');
@@ -1,3 +1,3 @@
1
1
  export const packageJson = {
2
- version: '5.8.5'
2
+ version: '5.8.7'
3
3
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highfivve/ad-tag",
3
- "version": "5.8.5",
3
+ "version": "5.8.7",
4
4
  "license": "Apache-2.0",
5
5
  "description": "An ad tag implementation called moli",
6
6
  "main": "./lib/index.js",