Generating ad tags

To generate a tag:

  1. From the Inventory tab, select the ad units for which you want to create ad tags and click Generate tags. A pop-up window opens.

  2. From the Tag type drop-down, select the type of tag you want to generate:

    • Google Publisher Tag
    • Mobile applications
    • JavaScript DART tag
    • iframe DART tag
    • Standard DART image ad tag

    DART ad tags are only available to networks that have formally upgraded from the legacy platform.

  3. Make selections based on the type of tag you've chosen (GPT or DART).

    • Google Publisher Tags:
      • Select whether the tag is for an out-of-page creative or whether you want to enable single request mode for the creative.

      • 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.

      • We generally recommend leaving the “Enable synchronous request” checkbox unchecked. This is because an asynchronous fetch means that the GPT code on your page does not block the HTML that follows it from loading. Learn more about choosing the right GPT mode.

    • DART tags:
      1. Select whether to include a cachebuster. We strongly recommend including a cachebuster to ensure that you're always making a fresh call to the ad server and not pulling creatives from a user's cache folder. Including a cachebuster can greatly help minimize impression counting discrepancies and ensure that roadblocks serve properly.

      2. Select your ad sizes. For JavaScript tags, you must select at least one ad size from the checkboxes in the tag generator. For iframe and image tags, you must select one ad size from the radio buttons in the tag generator.

      3. If you want to prefetch the ads and then register impressions for it via a view URL, append /pf* to the ad request. For example, /pfadj or /pfadi, instead of the usual /adj or /adi. Then to register an impression for this request, specify the %%VIEW_URL_UNESC%% macro (or %%VIEW_URL_ESC%% for Flash creatives).

  4. 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.

Definitions of standard DART ad tag attributes



a href

An HTML anchor element and hyperlink target attribute; this tag is a hypertext link to DFP.

img src

An HTML image element and source attribute; defines the location of a graphic file and requests a creative from DFP.

The generic address of the ad server;, is the address used for ads served from a data center. It will route traffic to the nearest data center. A data center is a collection of ad servers in one location.


Indicates the code for the DFP network in which this ad is booked. The network code can be found in the Admin tab of your DFP network. Ex: N1234.

For networks that upgraded from DART: All ads that you trafficked in DART will continue to serve to your current tags. Any new line items that are trafficked to sites or zones that you created in DART will continue to serve to those tags.

However, if you are generating ad tags for ad units that were created in DFP after you upgraded, those ad tags must have the network code in them.



A command, passed to the ad servers, that is used for counting clicks. This command is substituted dynamically with the click-through URL of the creative.


Indicates the type of creatives that an ad tag can serve.

The code:

Indicates an ad tag:


Can only accept image creatives.


Can accept Flash, rich media or image creatives in a frame.


Can accept Flash, rich media or image creatives in a layer.


Can accept Flash, rich media or image creatives in an iframe.


Can accept Flash, rich media or image creatives and will serve them by JavaScript.


Can accept Flash, rich media or image creatives and will serve them using streaming technologies.


The name of a first level ad unit in your DFP network. For information about ad units, see Identify your inventory.


The name of a second level ad unit in your DFP network. For information about ad units, please refer to Identify your inventory. Note that every tag must have a first-level ad unit, but including a second-level ad unit is optional.


A more granular way of defining your inventory than ad units. For more information about custom criteria and key-values, please refer to Design your inventory in the Getting started guide.


Indicates the dimensions of an ad slot (in pixels). You must always include the sz=widthxheight value in your ad tags. You can include up to eight creative sizes per ad slot. Dimensions are separated by commas (,).

For example: sz=468x60,728x90,100x100,120x600


A tile value is used to specify the order of an ad slot on a webpage. Without tile values properly implemented, you may find that roadblocks (creatives that are supposed to serve together) don’t always serve together, or that competitive exclusion doesn’t work properly. Tile values can also help prevent duplicate creatives from serving on the same page.

The top tag on the page should have tile=1 and the tags beneath should have tile=2, tile=3 and so on in descending order. Tile values are included in the ad tags of your website to enable DART to distinguish ad slots in the same webpage. Tile values range from 1-16, meaning that you cannot have more than 16 ad tags on a page.


The ord value is used for cache-busting; to ensure that a fresh call is made to the ad server every time a page loads. Without the ord value properly implemented, you may experience impression counting discrepancies.

You’ll need to add the ord value to the ad tags as per the examples above, and you’ll also need to have a piece of code in the top ad tag that generates a random number to populate the ord value on every tag. Make sure that you do not have more than one random number generator on the page. For example: var ord = Number(ord) || Math.floor(Math.random()*10e12);


If your website doesn't use UTF-8 encoding, add oe="encoding" to your tags, where encoding is the value in the "Encoding" column in the table below. This will re-encode creatives before they're sent to the page to avoid rendering issues in some browsers, such as Microsoft Internet Explorer 7.

Google name Encoding Associated Supported Languages
latin1 ISO-8859-1 Western European (Catalan, Danish, Dutch, English, Finnish, French, German, Indonesian, Italian, Norwegian, Portuguese, Spanish, Swedish)
latin2 ISO-8859-2 Eastern European (Croatian, Czech, Hungarian, Polish, Romanian, Serbian, Slovak, Slovenian)
latin3 ISO-8859-3  
latin4 ISO-8859-4 Baltic (Estonian, Latvian, Lithuanian)
cyrillic ISO-8859-5 Bulgarian, Russian
arabic ISO-8859-6  
greek ISO-8859-7 Greek
hebrew ISO-8859-8 Hebrew
latin5 ISO-8859-9  
latin6 ISO-8859-10 Icelandic
euc-jp EUC-JP Japanese
euc-kr EUC-KR Korean
sjis Shift_JIS Japanese
big5 Big5 Traditional Chinese
gb GB2312 Simplified Chinese
utf8 UTF-8 All
Training: Check out the DFP Inventory Fundamentals training module.