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. |
Try it
Add Google Analytics 4 as a statistics provider that sets the _ga cookie.