Full reach - AdManager example

by romanych

HTML

<html>
  <head>
  </head>
  <body>
  
    <div id='banner'></div>
    
    <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
    <script>
      window.googletag = window.googletag || { cmd: []  };
      googletag.cmd.push(function() {
        googletag.defineSlot('/171702534/full-reach-demo', [320, 480], 'banner')
          .addService(googletag.pubads());
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
      });
      
      AudienceProjectData.fetch("test", {
      	addStatusKey: true
      },
      function(result) {
          googletag.cmd.push(function() {
            if (result.keyValues) {
              for (var key in result.keyValues) {
                if (window.apDataKeyValues.hasOwnProperty(key)) {
                  googletag.pubads().setTargeting(key, result.keyValues[key]);
                }
              }
            }

            googletag.display('banner');
          })
        });
    </script>
  </body>
</html>