@highfivve/ad-tag 5.5.8 → 5.5.10

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
@@ -44,7 +44,12 @@ export const a9Init = (config, assetService) => mkInitStep('a9-init', (context)
44
44
  context.window__.apstag._Q.push(['ui', arguments]);
45
45
  }
46
46
  };
47
- if (context.env__ !== 'test' && hasRequiredConsent(context.tcData__)) {
47
+ const supportedByLabels = !config.labelAll ||
48
+ config.labelAll.every(label => context.labelConfigService__.getSupportedLabels().includes(label));
49
+ if (context.env__ !== 'test' &&
50
+ hasRequiredConsent(context.tcData__) &&
51
+ config.enabled !== false &&
52
+ supportedByLabels) {
48
53
  assetService
49
54
  .loadScript({
50
55
  name: 'A9',
@@ -72,6 +72,7 @@ export const createGlobalAuctionContext = (window, logger, eventService, config
72
72
  }
73
73
  const configureStep = mkConfigureStep('GlobalAuctionContext', context => {
74
74
  frequencyCapping?.updateAdUnitPaths(context.adUnitPathVariables__);
75
+ interstitial?.updateAdUnitPaths(context.adUnitPathVariables__);
75
76
  return Promise.resolve();
76
77
  });
77
78
  return {
@@ -36,6 +36,9 @@ const testAdSlot = (domId, adUnitPath) => ({
36
36
  },
37
37
  setConfig(_config) {
38
38
  return;
39
+ },
40
+ getConfig(_key) {
41
+ return;
39
42
  }
40
43
  });
41
44
  const configureTargeting = (window, runtimeKeyValues, serverSideTargeting) => {
@@ -140,7 +143,7 @@ export const gptDestroyAdSlots = () => {
140
143
  export const gptResetTargeting = () => mkConfigureStepOncePerRequestAdsCycle('gpt-reset-targeting', (context) => new Promise(resolve => {
141
144
  if (context.env__ === 'production') {
142
145
  context.logger__.debug('GAM', 'reset top level targeting');
143
- context.window__.googletag.pubads().clearTargeting();
146
+ context.window__.googletag.setConfig({ targeting: null });
144
147
  configureTargeting(context.window__, context.runtimeConfig__.keyValues, context.config__.targeting);
145
148
  }
146
149
  resolve();
@@ -339,12 +342,18 @@ export const gptDefineSlots = () => (context, slots) => {
339
342
  const checkAndSwitchToWebInterstitial = (slotsToRefresh, context) => {
340
343
  const interstitialSlot = slotsToRefresh.find(({ moliSlot }) => moliSlot.position === 'interstitial');
341
344
  if (interstitialSlot && context.auction__.interstitialChannel() === 'gam') {
345
+ const targeting = { ...interstitialSlot.adSlot.getConfig('targeting') };
342
346
  context.window__.googletag.destroySlots([interstitialSlot.adSlot]);
343
347
  const gamWebInterstitial = context.window__.googletag.defineOutOfPageSlot(resolveAdUnitPath(interstitialSlot.moliSlot.adUnitPath, context.adUnitPathVariables__), context.window__.googletag.enums.OutOfPageFormat.INTERSTITIAL);
344
348
  if (gamWebInterstitial) {
345
349
  context.logger__.debug('GAM', 'Display out-of-page-interstitial slot');
346
350
  gamWebInterstitial.addService(context.window__.googletag.pubads());
347
- gamWebInterstitial.setTargeting(formatKey, context.window__.googletag.enums.OutOfPageFormat.INTERSTITIAL.toString());
351
+ gamWebInterstitial.setConfig({
352
+ targeting: {
353
+ ...targeting,
354
+ [formatKey]: context.window__.googletag.enums.OutOfPageFormat.INTERSTITIAL.toString()
355
+ }
356
+ });
348
357
  context.window__.googletag.display(gamWebInterstitial);
349
358
  return [
350
359
  ...slotsToRefresh.filter(({ moliSlot }) => moliSlot.position !== 'interstitial'),
@@ -10,7 +10,7 @@ export const geoEdge = () => {
10
10
  }
11
11
  if (context.tcData__.gdprApplies &&
12
12
  (!context.tcData__.purpose.consents['1'] ||
13
- !context.tcData__.vendor.consents[geoEdgeGvlId])) {
13
+ !(!config.checkGVLID || context.tcData__.vendor.consents[geoEdgeGvlId]))) {
14
14
  context.logger__.warn(name, 'no gdpr consent, geoedge will not be loaded');
15
15
  return Promise.resolve();
16
16
  }
@@ -1,3 +1,3 @@
1
1
  export const packageJson = {
2
- version: '5.5.8'
2
+ version: '5.5.10'
3
3
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highfivve/ad-tag",
3
- "version": "5.5.8",
3
+ "version": "5.5.10",
4
4
  "license": "Apache-2.0",
5
5
  "description": "An ad tag implementation called moli",
6
6
  "main": "./lib/index.js",