Publisher

Base Technical Requirements

This module is GDPR and CCPA compliant, and no 3rd party userIds are allowed.

If you are a Publisher looking to integrate with AIDEM, you have two routes:

  • Prebid: you can add our Prebid Adapter to your header bidding setup.
  • GAM: you can create a Line Item, loading the code below as creative asset. This will not allow AIDEM to compete at impression level, and the Publisher will need to use average price bids to update the Line Item.
  • Server Side: the SSP natively inject the ads in the HTML of the page direclty on the publisher server/CDN, without requiring any code in page. These ads cannot be adblocked, allowing publishers to recover on average 30% of inventory. This is a custom implementation, needing developers, or if your website is using Cloudflare you can leverage our native integration.

Prebid Adapter Config

Bidder Bid Params

NameScopeDescriptionExampleType
siteIdrequiredUnique site ID. Using your domain name is a good pick.'ABCDEF'String
publisherIdrequiredUnique publisher ID'FEDCBA'String
placementIdoptionalUnique publisher tag ID'ABCDEF'String
rateLimitoptionalLimit the volume sent to AIDEM. Must be between 0 and 10.6Number
NameScopeDescriptionExampleType
sizesrequiredList of the sizes wanted[[300, 250], [300,600]]Array

Video Bid Params

NameScopeDescriptionExampleType
contextrequiredOne of instream, outstream, adpod'instream'String
playerSizerequiredWidth and height of the player'[640, 480]'Array
maxdurationrequiredMaximum video ad duration, in seconds30Integer
mindurationrequiredMinimum video ad duration, in seconds5Integer
mimesrequiredList of the content MIME types supported by the player["video/mp4"]Array
protocolsrequiredAn array of supported video protocols. At least one supported protocol must be specified, where: 2 = VAST 2.0 3 = VAST 3.0 5 = VAST 2.0 wrapper 6 = VAST 3.0 wrapper2Array

Additional Config

NameScopeDescriptionExampleType
coppaoptionalChild Online Privacy Protection ActtrueBoolean
consentManagementoptionalConsent Management Object{}Object
NameScopeDescriptionExampleType
gdproptionalGDPR Object see Prebid.js doc{}Object
uspoptionalUSP Object see Prebid.js doc{}Object

Supported Media Types

TypeSupport
BannerSupport all AIDEM Sizes
VideoSupport all AIDEM Sizes

First Party Data

Publishers supply First Party Data (FPD) by specifying attributes as configuration using Bidder-specific site data that applies to all AdUnits and auctions. Use setBidderConfig(). The Prebid First Party Data JSON structure reflects the OpenRTB standard: arbitrary attributes should go in ortb2.site.ext.data.

Supplying Bidder-Specific Data

pbjs.setBidderConfig({
   bidders: ['aidem'],
   config: {
       ortb2: {
           site: {
               ext: {
                   data: {
                      pageType: "article",
                      category: "tools"
                   }
               }
            }
       }
   }
});

Prebid adUnits examples

Example Banner ad unit

var adUnits = [{
    code: 'banner-prebid-test-site',
    mediaTypes: {
        banner: {
            sizes: [
                [300, 600],
                [300, 250]
            ]
        }
    },
    bids: [{
          bidder: 'aidem',
          params: {
              placementId: 'homepage/header',
              siteId: 'yourwebsitedomain.com',
              publisherId: '8000000000008',
          },
    }]
}];

Example Video ad unit

var adUnits = [{
    code: 'video-prebid-test-site',
    mediaTypes: {
      video: {
        context: 'instream',
        playerSize: [640, 480],
        maxduration: 30,
        minduration: 5,
        mimes: ["video/mp4"],
        protocols: 2
      }
    },
    bids: [{
          bidder: 'aidem',
          params: {
              placementId: 'videosection/preroll',
              siteId: 'yourwebsitedomain.com',
              publisherId: '8000000000008',
          },
    }]
}];

Prebid config examples

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function (){
  pbjs.setConfig({
    consentManagement: {
      gdpr:{
        cmpApi: 'iab'
      }
    }
  });
})
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function (){
  pbjs.setConfig({
    consentManagement: {
      usp:{
        cmpApi: 'static',
        consentData:{
          getUSPData:{
            uspString: '1YYY'
          }
        }
      }
    }
  });
})

Setting First Party Data (FPD)

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function (){
  pbjs.setConfig({
    ortb2: {
      site: {
        cat: ['IAB2'],
        sectioncat: ['IAB2-2'],
        keywords: 'power tools, drills'
      },
    }
  });
})

GAM Line Item Code Examples

US Compliant Code

<script type="text/javascript" src="https://zero.aidemsrv.com/dist/prebid.js" async></script>
    <script>
        var adUnits = [
            {
                code: 'zerossp-div',
                mediaTypes: {
                    banner: {
                        sizes: [[%%WIDTH%%, %%HEIGHT%%]],
                    }
                },
                bids: [
                    {
                        bidder: 'aidem',
                        params: {
                            placementId: '%%ADUNIT%%',
                            siteId: '[[TO_BE_REPLACED_WITH_YOUR_SITEID]]',
                            publisherId: '[[TO_BE_REPLACED_WITH_YOUR_PUBLISHERID]]',
                        }
                    }
                ]
            }
        ];

        var pbjs = pbjs || {};
        pbjs.que = pbjs.que || [];

        pbjs.que.push(function (){
            pbjs.setConfig({
                consentManagement: {
                    usp:{
                        cmpApi: 'static',
                        consentData:{
                            getUSPData:{
                                uspString: '%%TAG_PARAM:us_privacy%%'
                            }
                        }
                    }
                }
            });
        })
    </script>
    <script>
        pbjs.que.push(function() {
            pbjs.addAdUnits(adUnits);
        });

        function renderAllAdUnits() {
            var winners=pbjs.getHighestCpmBids();
            for (var i = 0; i < winners.length; i++) {
                renderOne(winners[i]);
            }
        }

        function renderOne(winningBid) {
            if (winningBid && winningBid.adId) {
                var div = document.getElementById(winningBid.adUnitCode);
                if (div) {
                    let iframe = document.createElement('iframe');
                    iframe.frameBorder = '0';
                    iframe.marginHeight = '0';
                    iframe.marginWidth = '0';
                    iframe.scrolling = 'no';
                    div.appendChild(iframe);
                    var iframeDoc = iframe.contentWindow.document;
                    pbjs.renderAd(iframeDoc, winningBid.adId);
                }
            }
        }

    </script>

    <script>
        pbjs.que.push(function() {
            pbjs.requestBids({
                timeout: 2000,
                bidsBackHandler: renderAllAdUnits
            });
        });
    </script>
<div id="zerossp-div"></div>

EU Compliant Code

<script type="text/javascript" src="https://zero.aidemsrv.com/dist/prebid.js" async></script>
    <script>
        var adUnits = [
            {
                code: 'zerossp-div',
                mediaTypes: {
                    banner: {
                        sizes: [[%%WIDTH%%, %%HEIGHT%%]],
                    }
                },
                bids: [
                    {
                        bidder: 'aidem',
                        params: {
                            placementId: '%%ADUNIT%%',
                            siteId: '[[TO_BE_REPLACED_WITH_YOUR_SITEID]]',
                            publisherId: '[[TO_BE_REPLACED_WITH_YOUR_PUBLISHERID]]',
                        }
                    }
                ]
            }
        ];

        var pbjs = pbjs || {};
        pbjs.que = pbjs.que || [];

        pbjs.que.push(function (){
            pbjs.setConfig({
                consentManagement: {
                    usp:{
                        cmpApi: 'static',
                        consentData:{
                            gdpr:{
                                cmpApi: 'iab'
                            }
                        }
                    }
                }
            });
        })
    </script>
    <script>
        pbjs.que.push(function() {
            pbjs.addAdUnits(adUnits);
        });

        function renderAllAdUnits() {
            var winners=pbjs.getHighestCpmBids();
            for (var i = 0; i < winners.length; i++) {
                renderOne(winners[i]);
            }
        }

        function renderOne(winningBid) {
            if (winningBid && winningBid.adId) {
                var div = document.getElementById(winningBid.adUnitCode);
                if (div) {
                    let iframe = document.createElement('iframe');
                    iframe.frameBorder = '0';
                    iframe.marginHeight = '0';
                    iframe.marginWidth = '0';
                    iframe.scrolling = 'no';
                    div.appendChild(iframe);
                    var iframeDoc = iframe.contentWindow.document;
                    pbjs.renderAd(iframeDoc, winningBid.adId);
                }
            }
        }

    </script>

    <script>
        pbjs.que.push(function() {
            pbjs.requestBids({
                timeout: 2000,
                bidsBackHandler: renderAllAdUnits
            });
        });
    </script>
<div id="zerossp-div"></div>