> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Label Assignment

> Attach or detach a label to/from campaigns, ad groups, ads, keywords, or the account

Attach or detach a label to/from campaigns, ad groups, ads, keywords, or the account

|                       |                                |
| --------------------- | ------------------------------ |
| **App**               | Google Ads                     |
| **Operation ID**      | `gads_manage_label_assignment` |
| **Type**              | Action                         |
| **Connection**        | `gads` (required)              |
| **Credits per run**   | 1                              |
| **Agent / MCP tool**  | Yes                            |
| **Requires approval** | Yes (write operation)          |

## Inputs

| Field         | Type                                                              | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                    |
| ------------- | ----------------------------------------------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account`     | GadsAccountItem or object or array of object or string or integer | Yes      | -       | Select the Google Ads account.                                                                                                                                                                                                                                                                                                                                 |
| `action`      | string or SelectableOption                                        | Yes      | -       | Choose whether to attach or detach a label. Options: 'attach', 'detach'.                                                                                                                                                                                                                                                                                       |
| `entity_type` | string or SelectableOption                                        | Yes      | -       | The type of entity to apply the label to. Options: 'campaign', 'ad\_group', 'ad', 'keyword', 'customer'.                                                                                                                                                                                                                                                       |
| `entity_ids`  | string or array of string                                         | No       | -       | Entity IDs to attach/detach the label to/from. Comma or newline separated. For ads, you can provide either a plain ad ID (e.g. 662800495135) or composite format (ad\_group\_id~~ad\_id). For keywords, you can provide either a plain keyword ID (e.g. 2076981815) or composite format (ad\_group\_id~~criterion\_id). Not needed for 'customer' entity type. |
| `label_id`    | string or SelectItem                                              | Yes      | -       | The label ID or name to attach or detach. If a name is provided, it will be looked up automatically.                                                                                                                                                                                                                                                           |

### GadsAccountItem

| Field       | Type   | Required | Default | Description                                                                                                                                                    |
| ----------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `value`     | string | Yes      | -       |                                                                                                                                                                |
| `label`     | string | Yes      | -       |                                                                                                                                                                |
| `managerId` | string | Yes      | -       | The manager ID for the Google Ads account. Ask  user to use the dropdown to select accounts, this manager id is selected background and not shown to the user. |

### SelectItem

| Field   | Type   | Required | Default | Description                                                                                          |
| ------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `value` | string | Yes      | -       | The value of the selectable item.                                                                    |
| `label` | string | Yes      | -       | The label of the selectable item, used for display purposes. If not provided, defaults to the value. |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `Dict`

Returns label assignment result.

**Fields**: `action`, `entity_type`, `count`
