Get the ad tag

Ad tags from the site level

When using ad tags from the site level, the Adfox interface creates a logical structure of your site that includes site sections and placement names in each section.

Sections have page templates that describe the range of URLs included in this section.

You need to get the ad tag and install it on all site pages. When a banner is requested, the server compares the address of the site page with the section templates, choosing the appropriate section and placement.

The Adfox interface lets you check what section of the site in Adfox a particular page will belong to.

Ad tags from the placement level

When using ad tags from the placement, you decide where each placement from any section is on the site (this scheme is used when it's difficult or impossible to set page templates for sections).

You set the logical structure of your site in the interface (sections and placements). Then, you take the tags from the placement level in each site section and manually install these tags in the appropriate places in your real site sections.

Leave the Allowed page URLs and Excluded page URLs boxes blank.

To enable getting ad tags from the placement level, contact support.

Learn more about working with an ad tag from the site level.

Ad tags from the banner placement level

In this case, you need to place the banner on the placement, take the ad tag from the banner placement level, and manually install it on the corresponding site pages. Allowed page URLs that you specified in the section parameters aren't checked at the time of the request.

If the banner from which you received the ad tag can't be served (for example, the banner isn't active), a placeholder is sent in response. Other banners placed on the same placement can't be selected for serving with this ad tag.

You can place the banner on multiple placements, but statistics are only collected for the placement where you received the ad tag.

To enable getting ad tags from the banner level, contact support.

From the banner placement level, you can also get a link to the pixel and click for measuring statistics.

Learn more about installing the ad tag from the banner placement level.

Container requirements for the ad tag

For the ad to be called correctly, the container must meet the following conditions:

  • The container or its parent elements can't have a display:none style, otherwise, the context.js library can't determine its size.

  • You can measure the container and parent element size.

    Note: if the parent element has a size set, but there are several nested elements without a size inside it, the container size is defined as 0 × 0. In this case, set the container size using the width or height(max-height) attributes and ensure that all nested elements have their size specified.

Container size check
  1. Before sending an ad request, the context.js library analyzes the size of the container with the ad tag. The request is sent only if the container size can be measured.
  2. If the container couldn't be measured, the context.js library sends a CONTAINER_IS_HIDDEN error to the browser console and waits for:
    • DOM (Document Object Model) to be completed.

    • Styles with sizes to be applied to the container.

    After that, a request is sent to the server.

Contact support