{"action":"opened","issue":{"url":"https://api.github.com/repos/prebid/Prebid.js/issues/2785","repository_url":"https://api.github.com/repos/prebid/Prebid.js","labels_url":"https://api.github.com/repos/prebid/Prebid.js/issues/2785/labels{/name}","comments_url":"https://api.github.com/repos/prebid/Prebid.js/issues/2785/comments","events_url":"https://api.github.com/repos/prebid/Prebid.js/issues/2785/events","html_url":"https://github.com/prebid/Prebid.js/issues/2785","id":336582246,"node_id":"MDU6SXNzdWUzMzY1ODIyNDY=","number":2785,"title":"Ads are not rendering on localhost or server.","user":{"login":"chandanonline4u","id":2093747,"node_id":"MDQ6VXNlcjIwOTM3NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/2093747?v=4","gravatar_id":"","url":"https://api.github.com/users/chandanonline4u","html_url":"https://github.com/chandanonline4u","followers_url":"https://api.github.com/users/chandanonline4u/followers","following_url":"https://api.github.com/users/chandanonline4u/following{/other_user}","gists_url":"https://api.github.com/users/chandanonline4u/gists{/gist_id}","starred_url":"https://api.github.com/users/chandanonline4u/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandanonline4u/subscriptions","organizations_url":"https://api.github.com/users/chandanonline4u/orgs","repos_url":"https://api.github.com/users/chandanonline4u/repos","events_url":"https://api.github.com/users/chandanonline4u/events{/privacy}","received_events_url":"https://api.github.com/users/chandanonline4u/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-28T11:29:36Z","updated_at":"2018-06-28T11:29:36Z","closed_at":null,"author_association":"NONE","body":"## Bug\r\nbug\r\n\r\n## Description\r\nI have downloaded the latest prebid.js with only appnexus adapter and included the same in html header and used the following inline script, please check and let me know if I am missing something.\r\n\r\nDo we require to make any configuration on prebid.js?\r\n\r\nHeader code:\r\n```\r\n<script type=\"text/javascript\" async src=\"https://www.googletagservices.com/tag/js/gpt.js\"></script>\r\n        <script type=\"text/javascript\" async=\"true\" src=\"prebid1.15.0.js\"></script>\r\n        <script type=\"text/javascript\">\r\n            var adsStart = (new Date()).getTime();\r\n           \r\n            function detectWidth() {\r\n                return window.screen.width || window.innerWidth || window.document.documentElement.clientWidth || Math.min(window.innerWidth, window.document.documentElement.clientWidth) || window.innerWidth || window.document.documentElement.clientWidth || window.document.getElementsByTagName('body')[0].clientWidth;\r\n            }\r\n\r\n            function detectDevice(){\r\n                var width = detectWidth();\r\n                if(width >= 992) return 'desktop';\r\n                else if(width >= 768) return 'tablet';\r\n                else return 'mobile';\r\n            }\r\n\r\n            var tableBreakSize = 960;\r\n            var mobileBreakSize = 768;\r\n            var device = \"desktop\";\r\n            if(detectWidth()<tableBreakSize) device = \"tablet\";\r\n            if(detectWidth()<mobileBreakSize) device = \"mobile\";\r\n\r\n            var PREBID_TIMEOUT = 2000;\r\n            var dfpNetwork = 183617012;\r\n            \r\n            var adsizes = [];\r\n            adsizes[\"VN_Horizontal_A\"] = [[728, 90],[970,90],[970,250]];\r\n            adsizes[\"VN_Postpage_Middle_A\"] = [[300, 250],[336,280]];\r\n            \r\n            if(detectDevice() == 'tablet') {\r\n                adsizes[\"VN_Horizontal_A\"] = [[728, 90]];\r\n                adsizes[\"VN_Postpage_Middle_A\"] = [[300, 250],[336,280]];      \r\n            }\r\n            if(detectDevice() == 'mobile') {\r\n                adsizes[\"VN_Horizontal_A\"] = [[320, 50]];\r\n                adsizes[\"VN_Postpage_Middle_A\"] = [[300, 250]];  \r\n            }    \r\n\r\n            var adUnits = [\r\n                {\r\n                    code: '/VN_Horizontal_A',\r\n                    mediaTypes: {\r\n                        banner: {\r\n                            sizes: adsizes[\"VN_Horizontal_A\"] \r\n                        }\r\n                    },\r\n                    bids: [{\r\n                        bidder: 'appnexus',\r\n                        params: {\r\n                            placementId: 13531251\r\n                        }\r\n                    }]\r\n                }\r\n                ,{\r\n                    code: dfpNetwork+'/VN_Postpage_Middle_A',\r\n                    mediaTypes: {\r\n                        banner: {\r\n                            sizes: adsizes['VN_Postpage_Middle_A']\r\n                        }\r\n                    },\r\n                    bids: [{\r\n                        bidder: 'appnexus',\r\n                        params: {\r\n                            placementId: 13531224\r\n                        }\r\n                    }]\r\n                }\r\n            ];\r\n\r\n            // ======== DO NOT EDIT BELOW THIS LINE =========== //\r\n            var googletag = googletag || {};\r\n            googletag.cmd = googletag.cmd || [];\r\n            var pbjs = pbjs || {};\r\n            pbjs.que = pbjs.que || [];\r\n\r\n            googletag.cmd.push(function() {\r\n                googletag.pubads().disableInitialLoad();\r\n            });\r\n\r\n            pbjs.que.push(function() {\r\n                pbjs.addAdUnits(adUnits);\r\n                pbjs.requestBids({\r\n                    bidsBackHandler: initAdserver\r\n                });\r\n            });\r\n\r\n            function initAdserver() {\r\n                if (pbjs.initAdserverSet) return;\r\n                pbjs.initAdserverSet = true;\r\n                googletag.cmd.push(function() {\r\n                    pbjs.que.push(function() {\r\n                        pbjs.setTargetingForGPTAsync();\r\n                        googletag.pubads().refresh();\r\n                    });\r\n                });\r\n            }\r\n            pbjs.timeout = setTimeout(function() {\r\n                initAdserver();\r\n            }, PREBID_TIMEOUT);\r\n            pbjs.timeStart = adsStart;\r\n\r\n            googletag.cmd.push(function() {\r\n                googletag.defineSlot(dfpNetwork+'/VN_Horizontal_A', adsizes[\"VN_Horizontal_A\"] , 'div1')\r\n                \t.addService(googletag.pubads());\r\n\r\n                googletag.defineSlot(dfpNetwork+'/VN_Postpage_Middle_A', adsizes['VN_Postpage_Middle_A'], 'div2')\r\n                \t.addService(googletag.pubads());\r\n                \r\n                googletag.pubads().enableSingleRequest();\r\n                googletag.enableServices();\r\n            });\r\n        </script>\r\n```\r\n\r\nBody Code:\r\n```\r\n<h5>Div-1</h5>\r\n<div id='div1'>\r\n            <script type='text/javascript'>\r\n                googletag.cmd.push(function() {\r\n                    googletag.display('div1');\r\n                });\r\n            </script>\r\n        </div>\r\n\r\n        <h5>Div-2</h5>\r\n        <div id='div2'>\r\n                <script type='text/javascript'>\r\n                    googletag.cmd.push(function() {\r\n                        googletag.display('div2');\r\n                    });\r\n                </script>\r\n            </div>\r\n```\r\n\r\n## Test page\r\nhttps://jsfiddle.net/chandanonline4u/8cmeazdk/1/\r\n\r\n### Expected results\r\nDisplay ads in two different slots.\r\n\r\n### Actual results\r\nAds are not rendering.\r\n\r\n## Platform details\r\nprebid.js: 1.15.0, browser: crome / MacOS\r\n\r\n## Other information\r\n\r\n"}}
{"actor":{"display_login":"chandanonline4u"}}