Skip to content

Commit

Permalink
Merge pull request #65 from theonion/ad-size-bugfix
Browse files Browse the repository at this point in the history
Fix for activeSizes issue
  • Loading branch information
spra85 authored Jun 12, 2018
2 parents 2fa4dc7 + 6ed4139 commit 64ec5b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ AdManager.prototype.configureAd = function (element) {
slot = this.googletag.defineSlot(adUnitPath, [], element.id);
sizeMap = this.buildSizeMap(adUnitConfig.sizes);
slot.defineSizeMapping(sizeMap);
slot.activeSizes = this.adUnitSizes(adUnitConfig.sizes);
}

if (!element.dataset) {
Expand All @@ -536,7 +537,6 @@ AdManager.prototype.configureAd = function (element) {

slot.addService(this.googletag.pubads());

slot.activeSizes = this.adUnitSizes(adUnitConfig.sizes);

if (adUnitConfig.eagerLoad) {
slot.eagerLoad = true;
Expand Down Expand Up @@ -633,7 +633,7 @@ AdManager.prototype.loadAds = function (element, updateCorrelator, useScopedSele
* requested from A9. It is thus used as a fallback.
* See Docs here https://developers.google.com/doubleclick-gpt/reference#googletagslot
*/
activeSizes = this.adUnitSizes(adUnitConfig.sizes);
activeSizes = slot.activeSizes

if (adUnitConfig.amazonEnabled && activeSizes && activeSizes.length) {
this.fetchAmazonBids(thisEl.id, activeSizes, adUnitConfig.slotName);
Expand Down Expand Up @@ -702,7 +702,7 @@ AdManager.prototype.refreshSlot = function (domElement) {
};

/**
* Fetches IAS brand safety targeting data
* Fetches IAS brand safety targeting data
*
* @param None
* @returns undefined
Expand Down

0 comments on commit 64ec5b5

Please sign in to comment.