@economist/component-ad-panel
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -63,6 +63,7 @@ 'use strict'; | ||
// Set targeting | ||
pubAds.setTargeting('subs', targeting.subscriber); | ||
if (targeting.etear) { | ||
pubAds.setTargeting('etear', targeting.etear); | ||
for (var targetingKey in targeting) { | ||
if (targeting.hasOwnProperty(targetingKey)) { | ||
pubAds.setTargeting(targetingKey, targeting[targetingKey]); | ||
} | ||
} | ||
@@ -377,2 +378,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUVBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7Ozs7Ozs7Ozs7QUFFQSxTQUFTLFFBQVQsR0FBb0I7QUFDbEIsTUFBTSw0QkFBNEIsSUFBbEM7QUFDQSxNQUFNLE1BQU0sRUFBWjtBQUNBLFNBQU8sQ0FBQyxLQUFLLE1BQUwsS0FBZ0IseUJBQWpCLEVBQTRDLFFBQTVDLENBQXFELEdBQXJELENBQVA7QUFDRDs7QUFFRCxJQUFJLGdCQUFnQixFQUFwQjtBQUNBLElBQU0sU0FBUyxFQUFmO0FBQ0EsU0FBUyxZQUFULENBQXNCLFNBQXRCLEVBQWlDO0FBQy9CLE1BQUksQ0FBQyxPQUFPLE1BQVosRUFBb0I7QUFDbEI7QUFDRDtBQUNELFlBQVUsY0FBVjtBQUNBLFNBQU8sT0FBUCxDQUFlLFVBQUMsR0FBRCxFQUFTO0FBQ3RCLGNBQVUsT0FBVixDQUFrQixHQUFsQjtBQUNELEdBRkQ7OztBQUtBLFNBQU8sTUFBUCxHQUFnQixDQUFoQjtBQUNEOztJQUVvQixPOzs7VUErQlosTSxtQkFBTyxPLEVBQVM7QUFDckIsUUFBTSxZQUFZLFFBQVEsb0JBQVIsRUFBbEI7QUFDQSxvQkFBZ0IsT0FBaEI7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QuUHJvcFR5cGVzLm51bWJlcixcbiAgICBzdHlsZWQ6IFJlYWN0LlByb3BUeXBlcy5ib29sLFxuICAgIGJsb2NrOiBSZWFjdC5Qcm9wVHlwZXMuYm9vbCxcbiAgICBvblNsb3RSZW5kZXJFbmRlZDogUmVhY3QuUHJvcFR5cGVzLmZ1bmMsXG4gICAgb25TbG90VmlzaWJpbGl0eUNoYW5nZWQ6IFJlYWN0LlByb3BUeXBlcy5mdW5jLFxuICAgIG9uSW1wcmVzc2lvblZpZXdhYmxlOiBSZWFjdC5Qcm9wVHlwZXMuZnVuYyxcbiAgfTtcbn1cbiJdfQ== |
{ | ||
"name": "@economist/component-ad-panel", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "An advert panel using GPT tags", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/economist-components/component-ad-panel", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
514080
595