{"_id":"59648359adeaa3006dc61c95","project":"574ff4bd3fa1870e00889ba6","version":{"_id":"574ff4bd3fa1870e00889ba9","project":"574ff4bd3fa1870e00889ba6","__v":20,"createdAt":"2016-06-02T08:56:29.492Z","releaseDate":"2016-06-02T08:56:29.492Z","categories":["574ff4bd3fa1870e00889baa","577278ecdceb570e003a9001","577279865617b117009e643f","577279985617b117009e6440","577279bc8c48e00e00503504","5774fe18605b770e0037be8a","577ce3ad87acf617003c4187","577f8476a77c700e006a6c52","57b486ae0d2b640e00e9d3f5","57b722133d3e620e004ec74b","57bd95f00fe3a00e003e2cc5","57c8349359cd4b0e00b888ef","57c8349b5754fa1700b12242","57cedb0bad483e0e00890239","57cedbe807d7ea0e00e438cc","57d82967156ef72b007ffcd8","58ee353ad1ee2f0f0034a13d","596623221738df00298622a5","59a51730192dba000fc9ca38","59a8129f1e7b26000fa0fb1a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"category":{"_id":"57c8349b5754fa1700b12242","project":"574ff4bd3fa1870e00889ba6","version":"574ff4bd3fa1870e00889ba9","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-01T14:00:59.579Z","from_sync":false,"order":12,"slug":"counter","title":"Ad Tag"},"user":"5770fa1ce5a0000e0023c680","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-07-11T07:50:49.264Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"PubNative supports integration with DFP as a Third Party ad source. If you’ve integrated the Google Mobile Ads SDK already, you don’t need to write any extra code! Instead, you can place a Third Party ad tag and target it to your existing inventory. Pubnative ad tag has built in support for failing over to the next ad source.\n\n## Login to your DFP account\n\n\n\n\n\n1. Go to the **Delivery** tab in your DFP account and click on the **Order** you want to use.\nIf you do not have a DFP order yet created, **[proceed to section A](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-a-in-your-delivery-page-click-on-new-order-)** in Appendix.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/535ffee-delivery.png\",\n        \"delivery.png\",\n        824,\n        478,\n        \"#eeeef0\"\n      ]\n    }\n  ]\n}\n[/block]\n2. Once inside the order, go to the line item you are using for the integration:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c67efde-line_item.png\",\n        \"line item.png\",\n        701,\n        537,\n        \"#ebecef\"\n      ]\n    }\n  ]\n}\n[/block]\n3. Double check that the size of the line item is the same as the size of the requested ad tag. In the next window inside of your line item, click on **Add creatives**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b29bdaf-add_creatives.png\",\n        \"add creatives.png\",\n        733,\n        529,\n        \"#eae3ca\"\n      ]\n    }\n  ]\n}\n[/block]\n4. The next window will show you the available type of creative that DFP support, click on the **Mobile App** tab if your integration is in app and then select **Third party**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/bc2f16d-new_creative.png\",\n        \"new creative.png\",\n        599,\n        420,\n        \"#e8e8e7\"\n      ]\n    }\n  ]\n}\n[/block]\n5. DFP will take you to the new creative page. Give a name to the creative and paste PubNative ad tag code:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/483d0d7-DFP.png\",\n        \"DFP.png\",\n        934,\n        639,\n        \"#dddeda\"\n      ]\n    }\n  ]\n}\n[/block]\nDFP will ask you to add the click macro, use the placement we already enabled for it, keep in mind that all macros have to be placed between the quotes. We recommend to use as well cachebuster macro and impression macro in order to avoid discrepancies. *(Impression macro still needs to be tested)*\n\nOnce the code and macros are placed click on save:\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a1f5a76-save_creatives.png\",\n        \"save creatives.png\",\n        686,\n        274,\n        \"#e0d599\"\n      ]\n    }\n  ]\n}\n[/block]\n6. Now the creative is saved. Go to **Inventory** on the top menu and write down the **ad unit** that will serve your order. If you have to create a new ad unit [**proceed to section B**](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-b-in-your-inventory-page-click-on-new-ad-unit-) in Appendix.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e86533a-ad_unit.png\",\n        \"ad unit.png\",\n        765,\n        478,\n        \"#f0f0f0\"\n      ]\n    }\n  ]\n}\n[/block]\n7. Go back to your order, then the line item that contains the ad tag creative and go to setting:\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/474872f-line_item_2.png\",\n        \"line item 2.png\",\n        961,\n        496,\n        \"#eeeded\"\n      ]\n    }\n  ]\n}\n[/block]\nAt the bottom of settings go to **Add targeting**, click on **Ad Units**, find the ad unit that will serve your order and click on **include**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c2f4dcf-ad_targeting.png\",\n        \"ad targeting.png\",\n        517,\n        343,\n        \"#eaeae5\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter including the ad unit is important to **save** the changes, the save button is at the bottom of the page.\n\n8.** IMPORTANT!** Avoid this step if you already have a tag integrated that includes an order with the ad tag.\nThe last step in this integration is the generation of the tag that will be implemented in your web app or native app.\nGo to **Inventory** and then click on **Generate tags** (left menu), afterwards include the ad unit that targets your order and include it. Once included click on **Generate tags**:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/14b1f2a-tag.png\",\n        \"tag.png\",\n        1095,\n        602,\n        \"#f0eff0\"\n      ]\n    }\n  ]\n}\n[/block]\nThe next screen is the last one in the DFP process. Select **Mobile applications** if your integration is in app, click on **Continue**. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/bce7839-mobile.png\",\n        \"mobile.png\",\n        226,\n        349,\n        \"#3860a6\"\n      ]\n    }\n  ]\n}\n[/block]\nFor in-app tags there are no extra options, click on **Continue** again and you will finally see you tag with it’s ID:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b33a9a0-size.png\",\n        \"size.png\",\n        673,\n        427,\n        \"#f1daa3\"\n      ]\n    }\n  ]\n}\n[/block]\nFor the final integration in you app follow Google’s guidelines from their documentation.\n\nFor mobile web integrations select **Google Publisher Tag**, click on continue and do not change the options, click on continue again and copy the tag head and body part into your web site.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f73d751-Publisher_Tag.png\",\n        \"Publisher Tag.png\",\n        258,\n        336,\n        \"#3962a8\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9ceda6a-tags_2.png\",\n        \"tags 2.png\",\n        762,\n        681,\n        \"#e5e4e3\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Appendix\"\n}\n[/block]\n## A. In your delivery page, click on New order:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/44be19a-new_order.png\",\n        \"new order.png\",\n        705,\n        183,\n        \"#efefef\"\n      ]\n    }\n  ]\n}\n[/block]\nFill all mandatory fields but pay special attention to **Inventory sizes**, the inventory size must match with the creative size.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2a7a32f-new_order_2.png\",\n        \"new order 2.png\",\n        693,\n        560,\n        \"#f1f0ef\"\n      ]\n    }\n  ]\n}\n[/block]\nSkip the **Add targeting** part and save. Now you the order has to be approved:\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9d3c49e-approve.png\",\n        \"approve.png\",\n        697,\n        158,\n        \"#427355\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce the order is approved go back to **[step 2](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-login-to-your-dfp-account)**.\n\n## B. In your inventory page click on **New ad unit**:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e9e86dd-new_ad_unit.png\",\n        \"new ad unit.png\",\n        460,\n        165,\n        \"#f0efef\"\n      ]\n    }\n  ]\n}\n[/block]\nFill the form and make sure that the **size** of the ad unit is the same as the size of the creative you want to traffic. Save the new ad unit, the button is at the bottom of the page.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6555979-size.png\",\n        \"size.png\",\n        673,\n        427,\n        \"#f1daa3\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce the ad unit is created go back to **[step 6](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-login-to-your-dfp-account)**.","excerpt":"","slug":"dfp-ad-tag-integration","type":"basic","title":"DFP Ad Tag Integration"}

DFP Ad Tag Integration


PubNative supports integration with DFP as a Third Party ad source. If you’ve integrated the Google Mobile Ads SDK already, you don’t need to write any extra code! Instead, you can place a Third Party ad tag and target it to your existing inventory. Pubnative ad tag has built in support for failing over to the next ad source. ## Login to your DFP account 1. Go to the **Delivery** tab in your DFP account and click on the **Order** you want to use. If you do not have a DFP order yet created, **[proceed to section A](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-a-in-your-delivery-page-click-on-new-order-)** in Appendix. [block:image] { "images": [ { "image": [ "https://files.readme.io/535ffee-delivery.png", "delivery.png", 824, 478, "#eeeef0" ] } ] } [/block] 2. Once inside the order, go to the line item you are using for the integration: [block:image] { "images": [ { "image": [ "https://files.readme.io/c67efde-line_item.png", "line item.png", 701, 537, "#ebecef" ] } ] } [/block] 3. Double check that the size of the line item is the same as the size of the requested ad tag. In the next window inside of your line item, click on **Add creatives**. [block:image] { "images": [ { "image": [ "https://files.readme.io/b29bdaf-add_creatives.png", "add creatives.png", 733, 529, "#eae3ca" ] } ] } [/block] 4. The next window will show you the available type of creative that DFP support, click on the **Mobile App** tab if your integration is in app and then select **Third party**. [block:image] { "images": [ { "image": [ "https://files.readme.io/bc2f16d-new_creative.png", "new creative.png", 599, 420, "#e8e8e7" ] } ] } [/block] 5. DFP will take you to the new creative page. Give a name to the creative and paste PubNative ad tag code: [block:image] { "images": [ { "image": [ "https://files.readme.io/483d0d7-DFP.png", "DFP.png", 934, 639, "#dddeda" ] } ] } [/block] DFP will ask you to add the click macro, use the placement we already enabled for it, keep in mind that all macros have to be placed between the quotes. We recommend to use as well cachebuster macro and impression macro in order to avoid discrepancies. *(Impression macro still needs to be tested)* Once the code and macros are placed click on save: [block:image] { "images": [ { "image": [ "https://files.readme.io/a1f5a76-save_creatives.png", "save creatives.png", 686, 274, "#e0d599" ] } ] } [/block] 6. Now the creative is saved. Go to **Inventory** on the top menu and write down the **ad unit** that will serve your order. If you have to create a new ad unit [**proceed to section B**](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-b-in-your-inventory-page-click-on-new-ad-unit-) in Appendix. [block:image] { "images": [ { "image": [ "https://files.readme.io/e86533a-ad_unit.png", "ad unit.png", 765, 478, "#f0f0f0" ] } ] } [/block] 7. Go back to your order, then the line item that contains the ad tag creative and go to setting: [block:image] { "images": [ { "image": [ "https://files.readme.io/474872f-line_item_2.png", "line item 2.png", 961, 496, "#eeeded" ] } ] } [/block] At the bottom of settings go to **Add targeting**, click on **Ad Units**, find the ad unit that will serve your order and click on **include**. [block:image] { "images": [ { "image": [ "https://files.readme.io/c2f4dcf-ad_targeting.png", "ad targeting.png", 517, 343, "#eaeae5" ] } ] } [/block] After including the ad unit is important to **save** the changes, the save button is at the bottom of the page. 8.** IMPORTANT!** Avoid this step if you already have a tag integrated that includes an order with the ad tag. The last step in this integration is the generation of the tag that will be implemented in your web app or native app. Go to **Inventory** and then click on **Generate tags** (left menu), afterwards include the ad unit that targets your order and include it. Once included click on **Generate tags**: [block:image] { "images": [ { "image": [ "https://files.readme.io/14b1f2a-tag.png", "tag.png", 1095, 602, "#f0eff0" ] } ] } [/block] The next screen is the last one in the DFP process. Select **Mobile applications** if your integration is in app, click on **Continue**. [block:image] { "images": [ { "image": [ "https://files.readme.io/bce7839-mobile.png", "mobile.png", 226, 349, "#3860a6" ] } ] } [/block] For in-app tags there are no extra options, click on **Continue** again and you will finally see you tag with it’s ID: [block:image] { "images": [ { "image": [ "https://files.readme.io/b33a9a0-size.png", "size.png", 673, 427, "#f1daa3" ] } ] } [/block] For the final integration in you app follow Google’s guidelines from their documentation. For mobile web integrations select **Google Publisher Tag**, click on continue and do not change the options, click on continue again and copy the tag head and body part into your web site. [block:image] { "images": [ { "image": [ "https://files.readme.io/f73d751-Publisher_Tag.png", "Publisher Tag.png", 258, 336, "#3962a8" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/9ceda6a-tags_2.png", "tags 2.png", 762, 681, "#e5e4e3" ] } ] } [/block] [block:api-header] { "title": "Appendix" } [/block] ## A. In your delivery page, click on New order: [block:image] { "images": [ { "image": [ "https://files.readme.io/44be19a-new_order.png", "new order.png", 705, 183, "#efefef" ] } ] } [/block] Fill all mandatory fields but pay special attention to **Inventory sizes**, the inventory size must match with the creative size. [block:image] { "images": [ { "image": [ "https://files.readme.io/2a7a32f-new_order_2.png", "new order 2.png", 693, 560, "#f1f0ef" ] } ] } [/block] Skip the **Add targeting** part and save. Now you the order has to be approved: [block:image] { "images": [ { "image": [ "https://files.readme.io/9d3c49e-approve.png", "approve.png", 697, 158, "#427355" ] } ] } [/block] Once the order is approved go back to **[step 2](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-login-to-your-dfp-account)**. ## B. In your inventory page click on **New ad unit**: [block:image] { "images": [ { "image": [ "https://files.readme.io/e9e86dd-new_ad_unit.png", "new ad unit.png", 460, 165, "#f0efef" ] } ] } [/block] Fill the form and make sure that the **size** of the ad unit is the same as the size of the creative you want to traffic. Save the new ad unit, the button is at the bottom of the page. [block:image] { "images": [ { "image": [ "https://files.readme.io/6555979-size.png", "size.png", 673, 427, "#f1daa3" ] } ] } [/block] Once the ad unit is created go back to **[step 6](http://developers.pubnative.net/v3.0/docs/dfp-ad-tag-integration#section-login-to-your-dfp-account)**.