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:

    Instream test parameters

    Instream test parameters (App)

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

    Test page example

    AdUnitId: ""17673122"

    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>