{"action":"created","issue":{"url":"https://api.github.com/repos/prebid/Prebid.js/issues/153","labels_url":"https://api.github.com/repos/prebid/Prebid.js/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/prebid/Prebid.js/issues/153/comments","events_url":"https://api.github.com/repos/prebid/Prebid.js/issues/153/events","html_url":"https://github.com/prebid/Prebid.js/issues/153","id":124918783,"number":153,"title":"Custom renderer for Criteo RTA","user":{"login":"BartVB","id":32803,"avatar_url":"https://avatars.githubusercontent.com/u/32803?v=3","gravatar_id":"","url":"https://api.github.com/users/BartVB","html_url":"https://github.com/BartVB","followers_url":"https://api.github.com/users/BartVB/followers","following_url":"https://api.github.com/users/BartVB/following{/other_user}","gists_url":"https://api.github.com/users/BartVB/gists{/gist_id}","starred_url":"https://api.github.com/users/BartVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BartVB/subscriptions","organizations_url":"https://api.github.com/users/BartVB/orgs","repos_url":"https://api.github.com/users/BartVB/repos","events_url":"https://api.github.com/users/BartVB/events{/privacy}","received_events_url":"https://api.github.com/users/BartVB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-05T08:30:47Z","updated_at":"2016-01-21T11:34:08Z","closed_at":null,"body":"This issue was prompted by: https://github.com/prebid/Prebid.js/issues/140#issuecomment-166663053\r\n\r\nThe Criteo tags are fairly simple:\r\n\r\n```javascript\r\n   document.MAX_ct0 ='INSERT_CLICK_URL';\r\n   var m3_u = (location.protocol=='https:'?'https://cas.criteo.com/delivery/ajs.php?':'http://cas.criteo.com/delivery/ajs.php?');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   document.write (\"<scr\"+\"ipt type='text/javascript' src='\"+m3_u);\r\n   document.write (\"zoneid=328667\");\r\n   document.write ('&amp;cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (\"&amp;exclude=\" + document.MAX_used);\r\n   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));\r\n   document.write (\"&amp;loc=\" + escape(window.location).substring(0,1600));\r\n   if (document.context) document.write (\"&context=\" + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (\"&amp;ct0=\" + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (\"&amp;mmm_fo=1\");\r\n   document.write (\"'></scr\"+\"ipt>\");\r\n```\r\n\r\nThe main complexity is that RTA returns a zone name but uses a zone ID in the tag. These two seem to be linked one on one. I.e. in my case when Criteo returns 'zone72890' I am supposed to load the above tag with zone ID '328667'. The size of the zone is also fixed per zone.\r\n\r\nSo the main things that are needed:\r\n- Linking zone names like 'zone72890' to a zone id like '328669'\r\n- Specifying which zone(s) can be use in what adUnit\r\n- Would be nice if the custom renderer had access to the DFP click URL\r\n\r\n\r\nSo changing this:\r\n\r\n```javascript\r\n            {\r\n                bidder: 'criteo',\r\n                params: {\r\n                    nid: '4909',\r\n                    cookiename: 'cto_rtt',\r\n                    varname: 'crtg_content'\r\n                }\r\n            }\r\n```\r\n\r\nto:\r\n\r\n```javascript\r\n            {\r\n                bidder: 'criteo',\r\n                params: {\r\n                    nid: '4909',\r\n                    cookiename: 'cto_rtt',\r\n                    varname: 'crtg_content'\r\n                    zones: [['zone72890', '328669'], ['zone72890-2', '328670']]\r\n                }\r\n            }\r\n```\r\n\r\nShould do the trick. The custom renderer should check the content of the 'keys' array to match the first zone name that's present in the 'zones' array for that adUnit and render the tag accordingly.\r\n\r\nThis would work in my setup, but N=1... I'm currently running a test with four zones; two sizes and two audience segments. I'm currently using DFP to match the segments, I would need to move that to the Prebid code if I wanted to use the custom renderer. Not a big deal in my specific case."},"comment":{"url":"https://api.github.com/repos/prebid/Prebid.js/issues/comments/173544576","html_url":"https://github.com/prebid/Prebid.js/issues/153#issuecomment-173544576","issue_url":"https://api.github.com/repos/prebid/Prebid.js/issues/153","id":173544576,"user":{"login":"BartVB","id":32803,"avatar_url":"https://avatars.githubusercontent.com/u/32803?v=3","gravatar_id":"","url":"https://api.github.com/users/BartVB","html_url":"https://github.com/BartVB","followers_url":"https://api.github.com/users/BartVB/followers","following_url":"https://api.github.com/users/BartVB/following{/other_user}","gists_url":"https://api.github.com/users/BartVB/gists{/gist_id}","starred_url":"https://api.github.com/users/BartVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BartVB/subscriptions","organizations_url":"https://api.github.com/users/BartVB/orgs","repos_url":"https://api.github.com/users/BartVB/repos","events_url":"https://api.github.com/users/BartVB/events{/privacy}","received_events_url":"https://api.github.com/users/BartVB/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T11:34:08Z","updated_at":"2016-01-21T11:34:08Z","body":"@cwbeck Criteo has several products for publishers. The default setup is the 'Publisher Marketplace' which allows you to create JS ad tags with corresponding passbacks. They also have 'RTA' which is their attempt at header bidding. You'll need your account manager to set you up. Their onboarding process is quite elaborate, took me a week to get everything properly setup, tested and approved. Still in the process of optimizing but I'm not that impressed so far."}}