Generate ad tags

You can easily customize and generate ad tags from the DFP interface without having to manually edit code.

For ease of use, it is possible to create ad tags from multiple places within the DFP interface, depending on the type of tags you wish to create. For instance, you are given the option of generating Audience pixel tags immediately after creating Audience segments. Learn more


To generate an ad tag for existing ad units:

  1. From the Inventory tab, click Generate tags.
  2. Click include next to the ad units to include in the tag.
  3. Click Generate tags to begin building the tag.
  4. Select the type of tag you want to generate:

    • Google Publisher Tag
    • Mobile applications
    • Audience pixel tag
  5. (Optional) Make additional selections based on the type of tag you've chosen.
    • Google Publisher Tags:
      • Enable single request: Single request mode means that instead of sending individual ad requests to DoubleClick servers, the browser is able to send one request notifying the server of all ad units on the page. This enables guaranteed roadblocking and improves page load time. Learn more
      • Enable synchronous requests: We recommend leaving this option unchecked, as an asynchronous fetch means that the GPT code on your page does not block the HTML that follows it from loading. Learn more

      Advanced features of the tag generator

      Options in this section are only available to publishers no longer using DART tags. If you don't have access to these options, you need to re-tag using GPT.
      • Create passback tag: This functionality can be used in any situation where an ad request to a third-party should ultimately be filled by an ad trafficked in your network. Learn more
      • Collapse empty divs: If you're using asynchronous mode and know that the ad slot is not always filled, you can instruct the browser to collapse empty divs. Learn more
      • Page-level targeting: Set custom attributes across all ad slots on the page to use less code and ensure ad slots have the same targeting attributes. Learn more
      • Out-of-page: Select whether the tag is for an out-of-page creative. Learn more
      • Inventory unit sizes: Select the inventory sizes for the tag. You can see applicable size options by clicking into this field. More than one size may be available. This is not applicable to out-of-page creatives. Learn more
      • Inventory unit level targeting: Set custom attributes across the selected inventory units. Learn more
  6. Send the tag to your web developer, who can paste the tag into the source code of the web page on which you want the ad slot.

App inventory

For app inventory, instead of an ad tag, you can use Google Mobile Ads SDK in most situations. Learn more in the Google developers documentation.

For in-stream video for apps, you can use the IMA SDK. We also recommend the use of Google Publisher Tags.

Was this article helpful?