ADFOX integration

  1. Integrate the Video Ads SDK using the script element in the HTML document header.

    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <script
                 type="text/javascript"
                 charset="utf-8"
                 src="https://yandex.ru/ads/system/adsdk.js"
            ></script>
        </head>
    </html>
    
  2. Set ADFOX parameters.

    var adFoxParameters = {
      adFoxParameters: {
        // ID in the ADFOX system (string)
        ownerId: "123456",
        // ADFOX parameters
        params: {
          p1: "123",
          p2: "123",
          ...
        },
      }
    }
    

    You can use these settings to test your ADFOX integration:

    Video block type

    Instream test parameters

    Instream test parameters (App)

    Pre-Roll

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwdyt",
          p2: "hiuy",
        },
      }
    }
    

    Test page example

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwekk",
          p2: "gmjh",
        },
      }
    }
    

    AdUnitId: "adf-270901/1303598"

    Mid-Roll

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwdys",
          p2: "hiux",
        },
      }
    }
    

    Test page example

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwekj",
          p2: "gmji",
        },
      }
    }
    

    AdUnitId: "adf-270901/1303597"

    Pause-Roll

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwdyr",
          p2: "hiuw",
        },
      }
    }
    

    Test page example

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwekm",
          p2: "gmjk",
         },
      }
    }
    

    AdUnitId: "adf-270901/1303600"

    Post-Roll

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwdym",
          p2: "hiuv",
         },
      }
    }
    

    Test page example

    var adFoxParameters = {
      adFoxParameters: {
        ownerId: "270901",
        params: {
          p1: "cwekl",
          p2: "gmjj",
        },
      }
    }
    

    AdUnitId: "adf-270901/1303599"

    If you don't know what parameters to add, contact ADFOX support.

  3. Call the play method using the script element in the HTML document header.

    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <script
                 type="text/javascript"
                 charset="utf-8"
                 src="https://yandex.ru/ads/system/adsdk.js"
            ></script>
             <script>
             // The method should be available directly from the loader.
             ya.videoAd.play({
               // Video element
               videoSlot: HTMLVideoElement,
               // An element for displaying controls. The element's position shouldn't be static.
               // You can use the video's parent element.
               slot: HTMLElement,
               // Loading config and ad playback config.
               config: AdConfig & PlaybackParams & adFoxParameters,
             }):Promise <
               reject: (error loading ad)
               resolve: (end of ad)
             >;
             </script>
        </head>
    </html>