<ad:adTarget> Tag

The <ad:adTarget> uses the Ad Service to send an ad query to the content management system. Unlike the <ph:placeholder> tag, the query in the <ad:adTarget> tag does not compete with other queries in an ad placeholder.

Use this tag if you need to make sure that a given ad displays to customers in a specific location. Depending on how narrowly you construct the query, you might have to remove or modify this tag when you want to display a different ad.

If the ad query returns more than one ad, the Ad Service uses the adWeight attribute of each ad to determine which ad to display.

Syntax

<tagName attribute="value" />

Attributes

query

Required (String) - The search query to execute based on the query syntax described in Building Content Queries with Expressions.

height

Optional (int) - The optional height (in pixels) of the rendered content.

width

Optional (int) - The optional width (in pixels) of the rendered content.

Example

The following example picks one of the ads in the ad group "Car" and renders it in a space measuring 200 x 400 pixels.

<ad:adTarget query="group == 'Car'" width="400" height="200" />

Related Topics

<ph:placeholder> Tag

<ad:render> Tag