- [HTTP request](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#body.request_body)
- [Response body](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#body.response_body)
  - [JSON representation](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#body.PlacementsGenerateTagsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#body.aspect)
- [TagProperties](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#TagProperties)
  - [JSON representation](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#TagProperties.SCHEMA_REPRESENTATION)
- [PlacementTag](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#PlacementTag)
  - [JSON representation](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#PlacementTag.SCHEMA_REPRESENTATION)
- [TagData](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#TagData)
  - [JSON representation](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#TagData.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#try-it)

Generates tags for a placement.

### HTTP request

`POST https://dfareporting.googleapis.com/dfareporting/v5/userprofiles/{profileId}/placements/generatetags`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `profileId` | `string (https://developers.google.com/discovery/v1/type-format format)` User profile ID associated with this request. |

### Query parameters

| Parameters ||
|---|---|
| `body` | `object` Empty body |
| `placementIds[]` | `string (https://developers.google.com/discovery/v1/type-format format)` Generate tags for these placements. |
| `campaignId` | `string (https://developers.google.com/discovery/v1/type-format format)` Generate placements belonging to this campaign. This is a required field. |
| `tagFormats[]` | ``enum (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements#PlacementTagFormat`)`` Tag formats to generate for these placements. **Note:** `PLACEMENT_TAG_STANDARD` can only be generated for 1x1 placements. |
| `tagProperties` | ``object (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#TagProperties`)`` Optional. Optional properties for the generated tags. |

### Request body

The request body must be empty.

### Response body

Placement GenerateTags Response

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "placementTags": [ { object (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#PlacementTag`) } ], "kind": string } ``` |

| Fields ||
|---|---|
| `placementTags[]` | ``object (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#PlacementTag`)`` Set of generated tags for the specified placements. |
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string `"dfareporting#placementsGenerateTagsResponse"`. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/dfatrafficking`

## TagProperties

Optional properties for the generated tags.

| JSON representation |
|---|
| ``` { "tcfGdprMacrosIncluded": boolean, "gppMacrosIncluded": boolean, "dcDbmMacroIncluded": boolean } ``` |

| Fields ||
|---|---|
| `tcfGdprMacrosIncluded` | `boolean` Optional. Indicates whether to include the TCF macro in the generated tags. Default true. [Learn more](https://support.google.com/campaignmanager/answer/10031693) about this macro. |
| `gppMacrosIncluded` | `boolean` Optional. Indicates whether to include the GPP macro in the generated tags. [Learn more](https://support.google.com/campaignmanager/answer/10031693) about this macro. |
| `dcDbmMacroIncluded` | `boolean` Optional. Indicates whether to include the dc_dbm macro in the generated tags. [Learn more](https://support.google.com/campaignmanager/answer/9280273) about this macro. |

## PlacementTag

Placement Tag

| JSON representation |
|---|
| ``` { "placementId": string, "tagDatas": [ { object (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#TagData`) } ] } ``` |

| Fields ||
|---|---|
| `placementId` | `string (https://developers.google.com/discovery/v1/type-format format)` Placement ID |
| `tagDatas[]` | ``object (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements/generatetags#TagData`)`` Tags generated for this placement. |

## TagData

Placement Tag Data

| JSON representation |
|---|
| ``` { "format": enum (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements#PlacementTagFormat`), "impressionTag": string, "clickTag": string, "adId": string, "creativeId": string } ``` |

| Fields ||
|---|---|
| `format` | ``enum (`https://developers.google.com/doubleclick-advertisers/rest/v5/placements#PlacementTagFormat`)`` TagData tag format of this tag. |
| `impressionTag` | `string` Tag string for serving an ad. |
| `clickTag` | `string` Tag string to record a click. |
| `adId` | `string (https://developers.google.com/discovery/v1/type-format format)` Ad associated with this placement tag. Applicable only when `format` is `PLACEMENT_TAG_TRACKING`. |
| `creativeId` | `string (https://developers.google.com/discovery/v1/type-format format)` Creative associated with this placement tag. Applicable only when `format` is `PLACEMENT_TAG_TRACKING`. |