You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bling.Render checks if gpt scriptLoaded for current component and if not it renders node element instead of script element and adds Bling instance into AdManager (in componentDidMount).
Some time later a half of ads get event 'onScriptLoaded' and method Bling.Render is called for Bling instances of these ads. In this time Bling.Render sees scriptLoaded is true and renders script element.
So there are two groups of ads in the same time:
the first group with scriptLoaded and script element rendered,
the second group have only node element rendered (scriptLoaded is false yet for them)
Suddenly AdManager.Render method is called (after debounce) and it starts to iterate over all Bling instances and invokes defineSlot() method. After that all Bling instances have got adSlot defined.
Next, the second group of ads get event 'onScriptLoaded' and method Bling.Render is called for Bling instances of these ads. Attention! These ads (Bling instances) do not have script element rendered (no _divId) but have adSlot defined. Bling.Render sees scriptLoaded is true and it tries to render script element, but before creating element it destroys the current adSlot if it exists.
Bling.js, lines 502-507
// clear the current ad if exists
this.clear();
if (this._adSlot) {
Bling._adManager.googletag.destroySlots([this._adSlot]);
this._adSlot = null;
}
As a result, the element is created but adSlot is destroyed (adSlot == null).
After that, according to our business logic if user scrolls down the page ads are updated. We do this by updating Bling targeting property, e.g. change some timestamp parameter. And when Bling.shouldComponentUpdate is called for the ad with destroyed adSlot, the Bling instance tries to call configureSlot for empty slot and method Bling.setAttributes(adSlot, attributes) throws an exception because of empty adSlot:
line 270
var attributeKeys = adSlot.getAttributeKeys();
So, why method Bling.Render destroys the current ad if it exists? Could it destroy ad slot only if the Bling instance has divId (script element rendered)?
The text was updated successfully, but these errors were encountered:
Hello,
We'have observed the following error in react-gpt (Windows 7, IE 11 mostly, but not only in this environment):
Bling.js, lines 502-507
As a result, the element is created but adSlot is destroyed (adSlot == null).
line 270
So, why method Bling.Render destroys the current ad if it exists? Could it destroy ad slot only if the Bling instance has divId (script element rendered)?
The text was updated successfully, but these errors were encountered: