Starting July 20, 2021, Adfox uses the universal ad loader code. Previously, different loader codes were used to load different types of Yandex Advertising Network and Adfox ad units. With the new codes, the browser does not waste time accessing multiple loads, so ads are served faster. The new Adfox banner ad tag is now asynchronous by default and contains a single yaContextCb loading queue: this optimizes loading of different types of ads on the page.
The old ad tags are compatible with the new ones, so you can change the banner codes on the pages of your site gradually. We recommend that you first make changes to one of the ad tags on the page and make sure that it works properly, and then move on to the next one.
Replacing the old ad tag with the new one
You can get the new ad tag in the Adfox interface:
At the site level: Open the Sites tab and click Ad tag next to the site name.
At the placement level: Go to Sites → Sections → Placements and click Ad tag next to the name of the site.
At the banner level: On the Campaigns tab, select a campaign, go to Banners → Placement and click Ad tag next to the desired placement.
To replace the ad tag manually:
Add the ad loader code to the <head> of each page where your ads are served:
The ad rendering function is no longer called immediately, but is added to a single call queue. When the browser downloads and runs the loader code, it parses the queue and calls the ad block ad tags. If the loader is already in the browser cache when loading the page, the ad tags are run faster.
Example of the new ad tag
<!-- In the site <head>, add the loader code once--><script>window.yaContextCb = window.yaContextCb || []</script><scriptsrc="https://yandex.ru/ads/system/context.js"async></script><!--Adfox START--><!--login--><!--Placement: example.pro / * / *--><!--Banner type: 100%х250 --><!--Position: <top of the page>--><divid="adfox_16244342575025707"></div><script>window.yaContextCb.push(()=>{
Ya.adfoxCode.create({
ownerId: 353052,
containerId: 'adfox_16244342575025707',
params: {
pp: 'g',
ps: 'ezwy',
p2: 'gnhv'
}
})
})
</script>