# Tag Manager Triggers

> Manage the triggers that fire tags inside a tag manager, including programmatic on-page event tracking. Triggers can be unconditional (e.g. PageView fires every page) or condition-gated (e.g. fire only when `event.amount > 100`).

Source: https://docs.oursprivacy.com/docs/platform-api/tag-manager-triggers

Triggers decide when [tags](https://docs.oursprivacy.com/docs/platform-api/tag-manager-tags) fire. Call `GET /rest/v1/tag-manager-triggers/types` for the full set of supported `type` values (e.g. `Initialization`, `PageView`, `DomReady`, `AllElementsClick`, `FormSubmit`, `CustomEvent`) and the per-type `parameters` schema. Triggers with no extra setup (e.g. a vanilla `PageView`) take `parameters: {}`.

`types` also returns `conditionOperators` (`id`, `name`, `takesExpected`) and `builtInVariables` (`name`, `reference`, `description`, `category`). Conditions use `{ actual, expected, comparison }`; `comparison` uses an operator `id` and built-ins use their exact `reference`, such as `{{Page Path}}`. Send `conditions: []` for an unconditional trigger. On PATCH, `conditions` is replaced in full.

## Programmatic On-Page Tracking

A browser interaction becomes a tracked event with a `CustomEvent` trigger and an [`OursTrackTag`](https://docs.oursprivacy.com/docs/platform-api/tag-manager-tags) that references the trigger ID. The page pushes the event to the data layer:

```javascript
document.querySelector('[data-demo-cta]').addEventListener('click', () => {
  window.dataLayer.push({ event: 'demo_cta_clicked' });
});
```

Create the trigger:

```json
{
  "tagManagerId": "TAG_MANAGER_ID",
  "name": "Demo CTA clicked",
  "type": "CustomEvent",
  "parameters": { "eventName": "demo_cta_clicked" },
  "conditions": []
}
```

Create the tag with the returned trigger ID:

```json
{
  "tagManagerId": "TAG_MANAGER_ID",
  "name": "Track demo CTA clicked",
  "type": "OursTrackTag",
  "parameters": { "eventName": "demo_cta_clicked" },
  "fireTriggerIds": ["TRIGGER_ID"]
}
```

Both records are drafts until published with `POST /rest/v1/versions`, scoped with `includeTagManagerTriggers` and `includeTagManagerTags`. See [Versions](https://docs.oursprivacy.com/docs/platform-api/versions).

Folder assignment goes through `POST /rest/v1/tag-manager-asset-folders`, so `folderId` is read-only on this endpoint.

## GET /rest/v1/tag-manager-triggers

List triggers inside a single tag manager. Requires the `tagManagerId` query parameter — triggers are always scoped to one parent container. Supports cursor pagination via `limit` and `cursor`; the limit clamp is 1000 so a single request can return the full set (the web-app workspace renders all triggers in one shot). Requires API-key scope or current OAuth user permission: tagManagers:find

Request URL: `GET https://app.oursprivacy.com/rest/v1/tag-manager-triggers`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `limit` | query | integer \| null | No | Maximum number of triggers to return. Defaults to 25; values below 1 are clamped to 1 and values above 1000 are clamped to 1000. The web-app passes 1000 to render the full workspace in one request. |
| `cursor` | query | string | No | Opaque pagination cursor from pagination.nextCursor in the previous response. Do not decode or modify it. Malformed cursors return 400 Bad Request. Opaque pagination cursor from pagination.nextCursor in the previous response. Do not decode or modify it. Malformed cursors return 400 Bad Request. |
| `tagManagerId` | query | string | Yes | Parent tag manager whose triggers should be returned. |

### Responses

- `200`: Triggers scoped to a parent tag manager
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entities` | object[] | Yes |  |
| `entities[].id` | string | Yes |  |
| `entities[].tagManagerId` | string | Yes |  |
| `entities[].accountId` | string | Yes |  |
| `entities[].name` | string | Yes |  |
| `entities[].type` | string | Yes | Trigger type discriminator. Examples that exist today: `PageView`, `DomReady`, `Initialization`, `AllElementsClick`, `AllLinksClick`, `FormSubmit`, `CustomEvent`, `ScrollReach`, `Timer`. Pick from `GET /tag-manager-triggers/types` for the canonical set. Note there is no plain `Click` id; use one of the `All*Click` variants. |
| `entities[].parameters` | object | Yes | Type-specific configuration. Send `{}` for a no-op trigger. |
| `entities[].conditions` | object[] | Yes | Conditions that must hold for the trigger to match. Use `[]` for unconditional triggers. |
| `entities[].enabled` | boolean \| null | No | Defaults to `true` on create. |
| `entities[].folderId` | string \| null | No | Folder this trigger belongs to. Settable via PATCH — send a folder UUID to assign, or `null` to remove from its current folder. |
| `entities[].createdAt` | string \| null | No |  |
| `entities[].updatedAt` | string \| null | No |  |
| `pagination` | object | Yes |  |
| `pagination.nextCursor` | string \| null | No |  |
| `pagination.hasMore` | boolean | Yes |  |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## POST /rest/v1/tag-manager-triggers

Create a new trigger inside a tag manager. `tagManagerId` is required in the body. Send `conditions: []` for an unconditional trigger; otherwise supply type-specific condition objects. Requires API-key scope or current OAuth user permission: tagManagers:update

Request URL: `POST https://app.oursprivacy.com/rest/v1/tag-manager-triggers`

Authentication: apiKey or oauth2.

### Request body (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tagManagerId` | string | Yes | Parent tag manager that will own the new trigger. |
| `name` | string | Yes |  |
| `type` | string | Yes | Trigger type discriminator. Pick from `GET /tag-manager-triggers/types` for the canonical set (e.g. `PageView`, `CustomEvent`, `AllElementsClick`). |
| `parameters` | object | Yes | Type-specific JSON configuration. |
| `conditions` | object[] | Yes | Match conditions; use `[]` for an unconditional trigger. Conditions are evaluated by the Tag Manager runtime. For a CSS selector click condition, send `{ "actual": "{{Click Element}}", "expected": ".cta", "comparison": "match_css_selector" }`. |
| `enabled` | boolean \| null | No | Defaults to `true`. |

### Responses

- `200`: Created trigger
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |
| `tagManagerId` | string | Yes |  |
| `accountId` | string | Yes |  |
| `name` | string | Yes |  |
| `type` | string | Yes | Trigger type discriminator. Examples that exist today: `PageView`, `DomReady`, `Initialization`, `AllElementsClick`, `AllLinksClick`, `FormSubmit`, `CustomEvent`, `ScrollReach`, `Timer`. Pick from `GET /tag-manager-triggers/types` for the canonical set. Note there is no plain `Click` id; use one of the `All*Click` variants. |
| `parameters` | object | Yes | Type-specific configuration. Send `{}` for a no-op trigger. |
| `conditions` | object[] | Yes | Conditions that must hold for the trigger to match. Use `[]` for unconditional triggers. |
| `enabled` | boolean \| null | No | Defaults to `true` on create. |
| `folderId` | string \| null | No | Folder this trigger belongs to. Settable via PATCH — send a folder UUID to assign, or `null` to remove from its current folder. |
| `createdAt` | string \| null | No |  |
| `updatedAt` | string \| null | No |  |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## GET /rest/v1/tag-manager-triggers/{id}

Find a single tag manager trigger by ID. Requires API-key scope or current OAuth user permission: tagManagers:find

Request URL: `GET https://app.oursprivacy.com/rest/v1/tag-manager-triggers/{id}`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Responses

- `200`: Trigger details
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |
| `tagManagerId` | string | Yes |  |
| `accountId` | string | Yes |  |
| `name` | string | Yes |  |
| `type` | string | Yes | Trigger type discriminator. Examples that exist today: `PageView`, `DomReady`, `Initialization`, `AllElementsClick`, `AllLinksClick`, `FormSubmit`, `CustomEvent`, `ScrollReach`, `Timer`. Pick from `GET /tag-manager-triggers/types` for the canonical set. Note there is no plain `Click` id; use one of the `All*Click` variants. |
| `parameters` | object | Yes | Type-specific configuration. Send `{}` for a no-op trigger. |
| `conditions` | object[] | Yes | Conditions that must hold for the trigger to match. Use `[]` for unconditional triggers. |
| `enabled` | boolean \| null | No | Defaults to `true` on create. |
| `folderId` | string \| null | No | Folder this trigger belongs to. Settable via PATCH — send a folder UUID to assign, or `null` to remove from its current folder. |
| `createdAt` | string \| null | No |  |
| `updatedAt` | string \| null | No |  |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## PATCH /rest/v1/tag-manager-triggers/{id}

Partially update a trigger. Only the fields you send are changed. `conditions` is replaced wholesale when sent. To assign a trigger to a folder, use `POST /rest/v1/tag-manager-asset-folders`. Requires API-key scope or current OAuth user permission: tagManagers:update

Request URL: `PATCH https://app.oursprivacy.com/rest/v1/tag-manager-triggers/{id}`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Request body (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | Updated trigger name. |
| `type` | string | No | Updated trigger type. Pick from `GET /tag-manager-triggers/types`. |
| `parameters` | object | No | Updated type-specific JSON configuration. |
| `conditions` | object[] | No | Replaces conditions wholesale when sent. Use `[]` for an unconditional trigger. |
| `enabled` | boolean \| null | No | Pause/resume the trigger without changing other fields. |

### Responses

- `200`: Updated trigger
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |
| `tagManagerId` | string | Yes |  |
| `accountId` | string | Yes |  |
| `name` | string | Yes |  |
| `type` | string | Yes | Trigger type discriminator. Examples that exist today: `PageView`, `DomReady`, `Initialization`, `AllElementsClick`, `AllLinksClick`, `FormSubmit`, `CustomEvent`, `ScrollReach`, `Timer`. Pick from `GET /tag-manager-triggers/types` for the canonical set. Note there is no plain `Click` id; use one of the `All*Click` variants. |
| `parameters` | object | Yes | Type-specific configuration. Send `{}` for a no-op trigger. |
| `conditions` | object[] | Yes | Conditions that must hold for the trigger to match. Use `[]` for unconditional triggers. |
| `enabled` | boolean \| null | No | Defaults to `true` on create. |
| `folderId` | string \| null | No | Folder this trigger belongs to. Settable via PATCH — send a folder UUID to assign, or `null` to remove from its current folder. |
| `createdAt` | string \| null | No |  |
| `updatedAt` | string \| null | No |  |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## DELETE /rest/v1/tag-manager-triggers/{id}

Delete a tag manager trigger. Requires API-key scope or current OAuth user permission: tagManagers:update

Request URL: `DELETE https://app.oursprivacy.com/rest/v1/tag-manager-triggers/{id}`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Responses

- `200`: Deleted successfully
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |
| `deleted` | boolean | Yes |  |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## GET /rest/v1/tag-manager-triggers/types

Lists every trigger template the platform supports — what `type` discriminator to send on create/patch, and the shape of the type-specific `parameters` payload. Also returns `conditionOperators` (`id`, `name`, `takesExpected`) and `builtInVariables` (`name`, `reference`, `description`, `category`). Use an operator `id` for `comparison` and an exact built-in `reference` such as `{{Page Path}}` for `actual`; built-ins need no variable creation. Account-agnostic: the response is the same for every API key. Requires API-key scope or current OAuth user permission: tagManagers:find

Request URL: `GET https://app.oursprivacy.com/rest/v1/tag-manager-triggers/types`

Authentication: apiKey or oauth2.

### Responses

- `200`: Trigger template descriptors
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entities` | object[] | Yes |  |
| `entities[].id` | string | Yes | Type discriminator — pass this as `type` on create/patch. |
| `entities[].name` | string | Yes | Human-readable display name. |
| `entities[].category` | string | Yes | Grouping label. |
| `entities[].description` | string \| null | No |  |
| `entities[].fields` | object[] | Yes |  |
| `entities[].fields[].id` | string | Yes | Parameter key that goes in the `parameters` payload at create/patch. |
| `entities[].fields[].type` | string | Yes | Underlying data type of the parameter value. One of: `"STRING"`, `"BOOLEAN"`, `"INTEGER"`, `"FLOAT"`, `"TABLE"`. |
| `entities[].fields[].title` | string | Yes | Human-readable title for the field. |
| `entities[].fields[].description` | string \| null | No |  |
| `entities[].fields[].required` | boolean \| null | No | When `true`, omitting or sending an empty value for this parameter on create/patch returns HTTP 400. |
| `entities[].fields[].default` | string \| null \| number \| boolean \| (string \| JsonValue[] \| object)[] \| object | No | Default value when the caller omits the parameter on create. |
| `entities[].fields[].availableValues` | object[] \| null | No | When present, the field accepts only one of these values. Send the `value` string in `parameters`; the `label` is for display. |
| `entities[].fields[].availableValues[].value` | string | Yes |  |
| `entities[].fields[].availableValues[].label` | string | Yes |  |
| `entities[].fields[].allowedKeys` | string[] \| null | No | For TABLE-typed fields, the predefined keys each row may contain. |
| `entities[].fields[].validators` | object[] \| null | No | Server-enforced rules applied to this field at create and patch. |
| `entities[].fields[].validators[].type` | string | Yes | One of: `"NotEmpty"`, `"CharacterLength"`, `"Url"`, `"Email"`, `"Number"`, `"Range"`. |
| `entities[].fields[].validators[].min` | number \| null | No |  |
| `entities[].fields[].validators[].max` | number \| null | No |  |
| `conditionOperators` | object[] | Yes | Supported comparisons for trigger conditions. |
| `conditionOperators[].id` | string | Yes | Exact comparison value for trigger conditions. |
| `conditionOperators[].name` | string | Yes | Display name of the comparison. |
| `conditionOperators[].takesExpected` | boolean | Yes | Whether this operator compares actual against an expected value. |
| `builtInVariables` | object[] | Yes | Built-in variables available to tags, triggers, and variables. |
| `builtInVariables[].name` | string | Yes | Case-sensitive built-in variable name. No variable creation is needed. |
| `builtInVariables[].reference` | string | Yes | Reference to use in conditions and template parameters, such as {{Page Path}}. |
| `builtInVariables[].description` | string | Yes | Value supplied by this built-in variable. |
| `builtInVariables[].category` | string \| null | Yes | Variable group, or null when uncategorized. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).
