Tool
consent_providers_create
Add a consent provider (and its cookies).
Behavior
- Fails when
- a non-necessary category is given with no hosts
- two cookies share a name within the provider
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | • | Provider display name, e.g. "Google Analytics 4". |
| category | string | • | Consent category: necessary, preferences, statistics, or marketing. |
| cookies | array | — | Cookies/storage entries this provider sets ([{ name, type, purpose, storageDuration }]). |
| hosts | array | — | Hostnames the provider loads scripts from. Required (min 1) for non-necessary categories. |
| privacyUrl | string | — | Link to the provider's privacy policy. |
| catalogKey | string | — | Catalog entry key for a provider created from the picker, 1–100 characters. |
| orderIndex | integer | — | Sort order, from 0 to 10000; lower values appear first. |
| description | string | — | Description shown in the consent UI, up to 4000 characters. Stored as an empty string when omitted. |
Try it
Add Google Analytics 4 as a statistics provider that sets the _ga cookie.