Skip to content

Consent

consent_providers_create

Add a consent provider (and its cookies).

Tool

Add a consent provider (and its cookies).

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.

When to use

Create a consent provider — a third party that sets cookies or storage — under a consent category (necessary, preferences, statistics, or marketing). Declare its cookies and the hosts it loads scripts from (required for non-necessary categories).

Example

Ask your agent something like this:

Add Google Analytics 4 as a statistics provider that sets the _ga cookie.

The agent will invoke consent_providers_create with these arguments:

{
  "name": "Google Analytics 4",
  "category": "statistics",
  "hosts": [
    "www.googletagmanager.com"
  ],
  "cookies": [
    {
      "name": "_ga",
      "type": "http_cookie",
      "storageDuration": "2 years"
    }
  ]
}

Esc

Start typing to search the docs.

navigate select