Clear search
Close search
Google apps
Main menu

Understanding ad tags

An ad tag is a piece of HTML or JavaScript code that your webmaster or developer inserts into the source code of a web page. You need to create a separate ad tag for each ad that you want to display on your website.

Ad tags tell DoubleClick for Publishers, "I belong to this ad unit. Please send me an ad that matches my targeting criteria and specified sizes." The ad server then identifies the best ad for this ad tag, logs an impression, and sends the ad to the ad tag to display on the page.

Note: For an app, instead of an ad tag, you can use Google Mobile Ads SDK in most situations. Learn more in the Google developers documentation and in the DFP Help Center.

If you want to do in-stream video for apps, you can use the IMA SDK. We also recommend the use of Google Publisher Tags (GPT).

You can see the relationship between an ad unit and its ad tag in the illustration below.

Conceptual image of how ad units appear on a page

Note that the ad doesn’t have to match all of the criteria in the ad tag in order to serve. For example, an ad targeted to a top-level ad unit called Sports (that includes no key-values or second-level ad unit targeting) could serve to an ad tag that includes a second-level ad unit and multiple key-values. As long as the targeting criteria in the ad tag matches the criteria for the line item (such as ad unit, key-value, or ad size), an ad will deliver.

Learn about generating ad tags.

Was this article helpful?
How can we improve it?