Adfox code forwarding
Description
With Adfox code forwarding, you can install the Adfox ad tag in the banner or the backup ad. The code will be executed on the page without re-initiating the context.js library, which significantly reduces the time before the banner is displayed.
Format features:
- Viewability check works for the banner that will eventually be displayed on the site.
- Click statistics for the Adfox code forwarding [context] banner isn't taken into account.
We recommend using the Code forwarding template to forward HTML5 code or ad tags of third-party systems.
Adfox code requirements
-
The original view of the ad tag:
<!--In the site <head>, add the loader code once--> <script>window.yaContextCb = window.yaContextCb || []</script> <script src="https://yandex.ru/ads/system/context.js" async></script> <!--Adfox START--> <div id="adfox_149487961538858600"></div> <script> window.yaContextCb.push(()=>{ Ya.adfoxCode.create({ ownerId: 168627, containerId: 'adfox_149487961538858600', params: { p1: 'bwfgn', p2: 'ekwx', pfc: 'bmtev', pfb: 'eokcn' } }) }) </script>
-
Copy the ad code parameters inside the parentheses in the form of an object. For example:
{ ownerId: 168627, containerId: 'adfox_149487961538858600', params: { p1: 'bwfgn', p2: 'ekwx', pfc: 'bmtev', pfb: 'eokcn' } }
Object properties can include:
ownerId
,params
,customDomain
.If no property is specified, the property from the ad code object of the previous request is used.
Add a banner
To add a banner with the Adfox code, use the Adfox code forwarding [context] template. If there is no such template in the banner type list, add it from the preset.
When adding a banner, specify the parameters:
-
Tracking pixel link: By default, the Adfox
//banners.adfox.ru/transparent.gif
pixel is used. If you want to count impressions in a third-party system, delete the Adfox pixel and specify another link. -
Re-request code parameters: Insert the ADFOX ad tag parameters.
Please note that when the banner is saved, the parameters of the re-request code will be wrapped in quotation marks in a special way. That is necessary for the code to work properly. Don't change the resulting code after saving the banner.
-
Name of the banner container class attribute: Enter a name (or multiple names separated by a space) for the
class
attribute of the banner container.
Example of a banner placement with the Adfox ad tag:
Note
Ad labeling must occur on the side of the forwarded code.
Add a backup ad
- To add a backup ad with the Adfox code, use the code generator.
- Select the code type that you place in the backup ad.
- Add tracking pixels if necessary.
- Copy the code and paste it in the Code box with the JavaScript type.
Example of placing a backup ad with the Adfox ad tag: