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:
- From the Inventory tab, click Generate tags.
- Click include next to the ad units to include in the tag.
- Click Generate tags to begin building the tag.
Select the type of tag you want to generate:
- (Optional) Make additional selections based on the type of tag you've chosen.
- Google Publisher Tag:
- 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 synchronous ad tags can delay the loading of a page's content. We recommend using asynchronous tags instead. Learn more about asynchronous tags and cases where it's still appropriate to use synchronous tags.
- Accelerated Mobile Pages tag Beta:
- Multi-size validation: When an ad has multiple sizes, secondary sizes must not be larger than the corresponding dimensions of the primary size. Also, the secondary sizes must not be smaller than 2/3 of the primary size. Deselect this value to turn off the validation. Learn more
- Include AMP placeholders: Select this value to add code for placeholders and fallback.
- Tag for child-directed treatment: Select this value to add to code to help facilitate compliance with the Children’s Online Privacy Protection Act (COPPA). Learn more
Advanced features of the tag generator
- 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
- Passback syntax: Choose between Standard GPT passback or GPT Light passback syntax. GPT Light passback tags are optimized for speed, while retaining most of the features of Standard GPT passbacks. 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
When you select "Accelerated Mobile Pages tag" Beta as the "Tag type" and "Fluid" as one of the "Inventory unit sizes," DFP currently generates the incorrect AMP Ad tag. This will be fixed soon.
- Inventory unit level targeting: Set custom attributes across the selected inventory units. Learn more
- Google Publisher Tag:
- 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.