{"_id":"58ed81791555632300d2ab39","__v":0,"user":"569d8ad30306a10d00ce9a1f","parentDoc":null,"category":{"_id":"5603738d0c78b00d0039af47","project":"5429beef1163360800ed31fa","pages":["561311eb41a9ec0d00a3fdf8","56958542cb14e11700f8a86e","56ad90e50c1cab0d009f658b"],"version":"5429beef1163360800ed31fd","__v":3,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-24T03:52:45.801Z","from_sync":false,"order":5,"slug":"exchange","title":"Marketplace"},"project":"5429beef1163360800ed31fa","version":{"_id":"5429beef1163360800ed31fd","__v":21,"project":"5429beef1163360800ed31fa","createdAt":"2014-09-29T20:19:59.904Z","releaseDate":"2014-09-29T20:19:59.904Z","categories":["5429beef1163360800ed31fe","55e74e1f5d36b32b002563fa","55e7500a73169617001f2e86","55e76b8196131b2f00bf4b72","55e89569cdbb8a350096df9c","55f8935eb089b71700a8364e","55f8a67d3bb4bb0d0022d093","55f9dbefc7ef770d00d9bf6d","5601c21a22ecf60d002b27b3","5601c21ff12aee0d001bb06e","5601c2256c7b610d00280db5","5601c22c22ecf60d002b27b4","5603738d0c78b00d0039af47","5626f70bfcbbc621004ebf52","566f7a1ae144ab0d00e9732f","566f85ca7820960d00c3b93d","56708ce43a32d20d00c45cbf","56708d436995210d003aad8e","5736471abe10a9200030732c","57a82c7aff9bd30e00a6f1c1","591b8500e3992319007190f4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-12T01:23:05.810Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":12,"body":"Polymorph Demand manager supports Publishers to setup 3rd party network tags to receive programmatic demand via Client side JavaScript tags with few simple steps. \n\nAll the client side network tags (Eg: Adx, OpenX, AOL etc. ) usually will have callback to indicate Polymorph if an AD was rendered by their tag or not. Please see this [documentation](https://dash.readme.io/legacy/project/antest/v1.0/docs/ad-network-integration-adsnative-mediation) about how to setup the callbacks to Polymorph within 3rd Party network tags if you are not aware.\n\nLets take Adx as an Example, Below are the steps to setup the tag with callbacks in Polymorph.\n\n***STEPS***\n\n1. Generate DFP/Adx tag : Go to your DFP account and generate the Ad tag. You can find the [documentation](https://support.google.com/dfp_sb/answer/177207?hl=en). \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script>\\nvar googletag = googletag || {};\\ngoogletag.cmd = googletag.cmd || [];\\n(function() {\\n    var gads = document.createElement('script');\\n    gads.async = true;\\n    gads.type = 'text/javascript';\\n    var useSSL = 'https:' == document.location.protocol;\\n    gads.src = (useSSL ? 'https:' : 'http:') +\\n        '//www.googletagservices.com/tag/js/gpt.js';\\n    var node = document.getElementsByTagName('script')[0];\\n    node.parentNode.insertBefore(gads, node);\\n})();\\n</script>\\n<script>\\ngoogletag.cmd.push(function() {\\n    googletag.defineSlot('/<YOUR_DFP_NETWORK_ID>/<YOUR_ADX_ADUNIT_ID', [ < AD_WIDTH > , < AD_HEIGHT], 'div-gpt-ad-1491956723083-0').addService(googletag.pubads());\\n    googletag.pubads().enableSingleRequest();\\n    googletag.enableServices();\\n});\\n</script>\\n<!-- /41710666/Feed -->\\n<div id='div-gpt-ad-1491956723083-0'>\\n    <script>\\n    googletag.cmd.push(function() {\\n        googletag.display('div-gpt-ad-1491956723083-0');\\n    });\\n    </script>\\n</div>\",\n      \"language\": \"text\",\n      \"name\": \"Sample Ad Tag from DFP\"\n    }\n  ]\n}\n[/block]\n2. Setting up Polymorph callbacks : If you have any other network partners to waterfall OR if you want to track network-fill & no-fill metrics in Polymorph, then this step applies to you. Else please skip this step.\n\nDFP \"slotRenderEnded\" callback integrated to listen the fill status from DFP.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script>\\nvar googletag = googletag || {};\\ngoogletag.cmd = googletag.cmd || [];\\n(function() {\\n    var gads = document.createElement('script');\\n    gads.async = true;\\n    gads.type = 'text/javascript';\\n    var useSSL = 'https:' == document.location.protocol;\\n    gads.src = (useSSL ? 'https:' : 'http:') +\\n        '//www.googletagservices.com/tag/js/gpt.js';\\n    var node = document.getElementsByTagName('script')[0];\\n    node.parentNode.insertBefore(gads, node);\\n})();\\n</script>\\n<script>\\ngoogletag.cmd.push(function() {\\n    googletag.defineSlot('/<YOUR_DFP_NETWORK_ID>/<YOUR_ADX_ADUNIT_ID', [ < AD_WIDTH > , < AD_HEIGHT], 'div-gpt-ad-1491956723083-0').addService(googletag.pubads());\\n    googletag.pubads().enableSingleRequest();\\n    \\n    // Call AdsNative callbacks\\n    pubads.addEventListener('slotRenderEnded', function(event) {\\n    \\tif (event.isEmpty && window._an_adNoFill) {\\n        window._an_adNoFill('google_dfp');\\n    \\t} else if (window._an_adFill) {\\n        window._an_adFill('google_dfp');\\n    \\t}\\n\\t\\t});\\n\\n    googletag.enableServices();\\n});\\n</script>\\n<!-- /41710666/Feed -->\\n<div id='div-gpt-ad-1491956723083-0'>\\n    <script>\\n    googletag.cmd.push(function() {\\n        googletag.display('div-gpt-ad-1491956723083-0');\\n    });\\n    </script>\\n</div>\",\n      \"language\": \"text\",\n      \"name\": \"After Adding AdsNative Fill/NoFill Callbacks\"\n    }\n  ]\n}\n[/block]\n\n3. Once you have the above tag ready, Create a network campaign in Polymorph\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c512cdc-Screen_Shot_2017-04-11_at_6.28.12_PM.png\",\n        \"Screen Shot 2017-04-11 at 6.28.12 PM.png\",\n        678,\n        220,\n        \"#042444\"\n      ],\n      \"caption\": \"Open \\\"NETWORKS\\\" tab from your Polymorph dashboard and click \\\"Add Network\\\" button.\"\n    }\n  ]\n}\n[/block]\n4. Choose \"Custom\" as the network type in the pop up as shown below\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/42cfbac-Screen_Shot_2017-04-11_at_6.29.54_PM.png\",\n        \"Screen Shot 2017-04-11 at 6.29.54 PM.png\",\n        738,\n        370,\n        \"#f7f7f8\"\n      ]\n    }\n  ]\n}\n[/block]\n5. Rename the network from \"Custom\" to the actual adtag that you are are setting up, in this example it is \"Google DFP Adx\"\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2e6e8ae-Screen_Shot_2017-04-11_at_6.32.11_PM.png\",\n        \"Screen Shot 2017-04-11 at 6.32.11 PM.png\",\n        508,\n        234,\n        \"#e34d3d\"\n      ],\n      \"caption\": \"Renamed \\\"Custom\\\" to \\\"Google DFP Adx\\\"\"\n    }\n  ]\n}\n[/block]\n6. Copy and paste the entire DFP Adx tag that you generated above into the HTML field as shown below\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/10aa7f4-Screen_Shot_2017-04-11_at_6.40.56_PM.png\",\n        \"Screen Shot 2017-04-11 at 6.40.56 PM.png\",\n        948,\n        635,\n        \"#d5dade\"\n      ],\n      \"caption\": \"Adx tag setup in HTML field.\"\n    }\n  ]\n}\n[/block]\n7. Setup Average eCPM that the network partner has quoted to start with. This will be static eCPM that Polymorph will be using during campaign selection. \n\nIf you have other networks also setup along with Adx, then to optimize the revenue you will need to manually login to Adx dashboard and pull the average eCPM and update the number in Polymorph, else set some random eCPM and save it. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ad68af9-Screen_Shot_2017-04-11_at_6.42.43_PM.png\",\n        \"Screen Shot 2017-04-11 at 6.42.43 PM.png\",\n        822,\n        327,\n        \"#c9d2d8\"\n      ],\n      \"caption\": \"Example where the Adx campaign is targeted to a certain placement and has a $1 eCPM setup.\"\n    }\n  ]\n}\n[/block]\n8. Setup all the remaining targeting like Geo, device, Segments, dates etc similar to a standard direct sold campaign. You can find more information in this [documentation](https://dev.getpolymorph.com/docs/editing-campaign-settings) \n\n\nThats it. You are all set. If you are using Render JS as your integration approach then these networks do get rendered seamlessly without any additional development work on publisher's end. Adserver during the adselection process, chooses these network campaigns similar to any other direct sold or private exchange campaigns.","excerpt":"","slug":"setup-3rd-party-network-tag-in-adsnative","type":"basic","title":"Setting up a 3rd Party Network tag in Polymorph"}

Setting up a 3rd Party Network tag in Polymorph


Polymorph Demand manager supports Publishers to setup 3rd party network tags to receive programmatic demand via Client side JavaScript tags with few simple steps. All the client side network tags (Eg: Adx, OpenX, AOL etc. ) usually will have callback to indicate Polymorph if an AD was rendered by their tag or not. Please see this [documentation](https://dash.readme.io/legacy/project/antest/v1.0/docs/ad-network-integration-adsnative-mediation) about how to setup the callbacks to Polymorph within 3rd Party network tags if you are not aware. Lets take Adx as an Example, Below are the steps to setup the tag with callbacks in Polymorph. ***STEPS*** 1. Generate DFP/Adx tag : Go to your DFP account and generate the Ad tag. You can find the [documentation](https://support.google.com/dfp_sb/answer/177207?hl=en). [block:code] { "codes": [ { "code": "<script>\nvar googletag = googletag || {};\ngoogletag.cmd = googletag.cmd || [];\n(function() {\n var gads = document.createElement('script');\n gads.async = true;\n gads.type = 'text/javascript';\n var useSSL = 'https:' == document.location.protocol;\n gads.src = (useSSL ? 'https:' : 'http:') +\n '//www.googletagservices.com/tag/js/gpt.js';\n var node = document.getElementsByTagName('script')[0];\n node.parentNode.insertBefore(gads, node);\n})();\n</script>\n<script>\ngoogletag.cmd.push(function() {\n googletag.defineSlot('/<YOUR_DFP_NETWORK_ID>/<YOUR_ADX_ADUNIT_ID', [ < AD_WIDTH > , < AD_HEIGHT], 'div-gpt-ad-1491956723083-0').addService(googletag.pubads());\n googletag.pubads().enableSingleRequest();\n googletag.enableServices();\n});\n</script>\n<!-- /41710666/Feed -->\n<div id='div-gpt-ad-1491956723083-0'>\n <script>\n googletag.cmd.push(function() {\n googletag.display('div-gpt-ad-1491956723083-0');\n });\n </script>\n</div>", "language": "text", "name": "Sample Ad Tag from DFP" } ] } [/block] 2. Setting up Polymorph callbacks : If you have any other network partners to waterfall OR if you want to track network-fill & no-fill metrics in Polymorph, then this step applies to you. Else please skip this step. DFP "slotRenderEnded" callback integrated to listen the fill status from DFP. [block:code] { "codes": [ { "code": "<script>\nvar googletag = googletag || {};\ngoogletag.cmd = googletag.cmd || [];\n(function() {\n var gads = document.createElement('script');\n gads.async = true;\n gads.type = 'text/javascript';\n var useSSL = 'https:' == document.location.protocol;\n gads.src = (useSSL ? 'https:' : 'http:') +\n '//www.googletagservices.com/tag/js/gpt.js';\n var node = document.getElementsByTagName('script')[0];\n node.parentNode.insertBefore(gads, node);\n})();\n</script>\n<script>\ngoogletag.cmd.push(function() {\n googletag.defineSlot('/<YOUR_DFP_NETWORK_ID>/<YOUR_ADX_ADUNIT_ID', [ < AD_WIDTH > , < AD_HEIGHT], 'div-gpt-ad-1491956723083-0').addService(googletag.pubads());\n googletag.pubads().enableSingleRequest();\n \n // Call AdsNative callbacks\n pubads.addEventListener('slotRenderEnded', function(event) {\n \tif (event.isEmpty && window._an_adNoFill) {\n window._an_adNoFill('google_dfp');\n \t} else if (window._an_adFill) {\n window._an_adFill('google_dfp');\n \t}\n\t\t});\n\n googletag.enableServices();\n});\n</script>\n<!-- /41710666/Feed -->\n<div id='div-gpt-ad-1491956723083-0'>\n <script>\n googletag.cmd.push(function() {\n googletag.display('div-gpt-ad-1491956723083-0');\n });\n </script>\n</div>", "language": "text", "name": "After Adding AdsNative Fill/NoFill Callbacks" } ] } [/block] 3. Once you have the above tag ready, Create a network campaign in Polymorph [block:image] { "images": [ { "image": [ "https://files.readme.io/c512cdc-Screen_Shot_2017-04-11_at_6.28.12_PM.png", "Screen Shot 2017-04-11 at 6.28.12 PM.png", 678, 220, "#042444" ], "caption": "Open \"NETWORKS\" tab from your Polymorph dashboard and click \"Add Network\" button." } ] } [/block] 4. Choose "Custom" as the network type in the pop up as shown below [block:image] { "images": [ { "image": [ "https://files.readme.io/42cfbac-Screen_Shot_2017-04-11_at_6.29.54_PM.png", "Screen Shot 2017-04-11 at 6.29.54 PM.png", 738, 370, "#f7f7f8" ] } ] } [/block] 5. Rename the network from "Custom" to the actual adtag that you are are setting up, in this example it is "Google DFP Adx" [block:image] { "images": [ { "image": [ "https://files.readme.io/2e6e8ae-Screen_Shot_2017-04-11_at_6.32.11_PM.png", "Screen Shot 2017-04-11 at 6.32.11 PM.png", 508, 234, "#e34d3d" ], "caption": "Renamed \"Custom\" to \"Google DFP Adx\"" } ] } [/block] 6. Copy and paste the entire DFP Adx tag that you generated above into the HTML field as shown below [block:image] { "images": [ { "image": [ "https://files.readme.io/10aa7f4-Screen_Shot_2017-04-11_at_6.40.56_PM.png", "Screen Shot 2017-04-11 at 6.40.56 PM.png", 948, 635, "#d5dade" ], "caption": "Adx tag setup in HTML field." } ] } [/block] 7. Setup Average eCPM that the network partner has quoted to start with. This will be static eCPM that Polymorph will be using during campaign selection. If you have other networks also setup along with Adx, then to optimize the revenue you will need to manually login to Adx dashboard and pull the average eCPM and update the number in Polymorph, else set some random eCPM and save it. [block:image] { "images": [ { "image": [ "https://files.readme.io/ad68af9-Screen_Shot_2017-04-11_at_6.42.43_PM.png", "Screen Shot 2017-04-11 at 6.42.43 PM.png", 822, 327, "#c9d2d8" ], "caption": "Example where the Adx campaign is targeted to a certain placement and has a $1 eCPM setup." } ] } [/block] 8. Setup all the remaining targeting like Geo, device, Segments, dates etc similar to a standard direct sold campaign. You can find more information in this [documentation](https://dev.getpolymorph.com/docs/editing-campaign-settings) Thats it. You are all set. If you are using Render JS as your integration approach then these networks do get rendered seamlessly without any additional development work on publisher's end. Adserver during the adselection process, chooses these network campaigns similar to any other direct sold or private exchange campaigns.