Search Images Maps Play YouTube News Gmail Drive More »
Sign in

Getting started

Getting started guide

Generate ad tags

The DFP Small Business tag generator can automatically generate the HTML and JavaScript necessary to integrate one or more ad units on a page. Using the ad tag generator is optional, but generally easier and less error-prone than manually rewriting code.

To generate tags for one or more ad units:

  1. In your DFP Small Business account, click the Inventory tab.

  2. Click Generate tags on the left-hand panel.

  3. Select ad units by clicking include next to the appropriate ad unit names. (You can generate tags for all ad units at once or page by page.)

  4. Click Generate tags. A text field with the full HTML for the page, including the selected ad units, will appear.

  5. Copy the code and send it to your webmaster, who will place it in the HTML of the appropriate pages.

 

Div IDs in Google Publisher Tags

Div IDs must be consistent between a web page's header and body as well as unique for the page so that there's no ambiguity about where the GPT script will place the ad once it receives the response from the ad server.

The tag generator randomly generates div IDs to ensure they are unique for that page. However, you can manually label div IDs with something more intuitive, for example, leaderboard-1, right-300x250 as long as you ensure that the ID is only used once on a particular page.