Partners of the Yandex Advertising Network can now automatically show alternative advertisements (social, internal, other contextual or banner advertising systems) if Yandex.Direct or Yandex.Market ads have not been selected for the pages of the site.
This can be done using the variable yandex_ad_is_displayed. It shows whether the display of Yandex ad units has materialized.
On the technical side, it looks like this: the function returns true if the last time the ad code for the Yandex.Direct ad or Yandex.Market ad was shown was displayed, and false if no ads were shown.
')
To take advantage of the new feature, you need to install an advertisement call code from the
new constructor on the site.
Then after the call code of the advertisement you need to add such a block:
‹Script type =" text / javascript "›
if (yandex_ad_is_displayed == false) {
‹! - advertising call code -›
}
‹/ Script›
where instead of "‹! - call code advertising - ›" you need to substitute the code call alternative advertising.
This feature will be especially useful for ad units of a
fixed format that have recently appeared in the constructor. If there are no ads from Yandex.Direct or Yandex.Market, the block can be automatically replaced with an advertising banner of the same size so that it always fits into the site design.
For example, to display a fixed-size banner 468x60, you need to add the following code after the standard ad call code:
‹Script type =" text / javascript "›
if (yandex_ad_is_displayed == false) {
‹! - Enter the address of your advertised page and the link to the banner -›
document.write ('‹a href=alk slovari.yandex.ru "› ‹img src =" help.yandex.ru/partner/i/direct-468x60.gif "width =" 468 "height =" 60 "› ‹ / a ›');
}
‹/ Script›
This feature is available only for contextual sites. If there are
several blocks of contextual advertising on the page, then after each of them you can check whether something was shown or not.