legal_put_consent
Configure the consent banner and tracking credentials for GTM, GA4, Google Ads, and Ahrefs, merging only supplied keys. Block all tracking requests until the visitor accepts.
Instructions
Configure the consent banner and every tracking credential the site uses. Merges: only the keys given change, an omitted key keeps its stored value, an empty string clears an id. Nothing is handed to the browser until the visitor accepts - this plugin owns GTM, GA4, Google Ads and Ahrefs Web Analytics precisely because it owns the gate. Search-engine verification meta tags are NOT here; those belong to cvrt-seo-manager because they fire no request. Returns { saved: true }; read the result back with legal_get_consent.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site": "<site>"
},
"name": "legal_put_consent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | Site id (see list_sites) | |
| ads_id | No | Google Ads conversion id AW-123456789 (cvrt-legal 0.10.0+). On a GA4-direct site (no GTM container) gtag configures it after Marketing consent; with a container it only documents the account (the container fires Ads) and makes the banner list Google Ads under Marketing. Empty clears it. | |
| ga4_id | No | GA4 measurement id G-XXXXXXXXXX. Without a GTM container gtag.js loads it after Statistik consent; with a container it names the property the container loads, which the banner keeps off until Statistik consent. Empty clears it. | |
| gtm_id | No | GTM container id GTM-XXXXXXX, loaded only after consent; empty clears it | |
| enabled | No | Banner on/off. Off also switches every consent gate off, so nothing tracked loads at all | |
| backdrop | No | Dim and block the page behind the banner until the visitor decides (default true). Never applied on the privacy, imprint or any linked legal page. | |
| ahrefs_key | No | Ahrefs Web Analytics data-key. Cookieless but still a third-party request, so it is consent-gated and must be named in the Datenschutz text before enabling. Empty clears it. | |
| loader_url | No | Optional first-party GTM loader URL. Leave empty to load straight from googletagmanager.com (the default on all our sites) | |
| log_enabled | No | Turn the consent decision log on or off. Stays off (the default) until a 'einwilligungsnachweis' section exists in the Datenschutz document - set it only after that section is in place. Switching it rewrites a generated Datenschutz. | |
| gtm_services | No | What the GTM container fires, per category, for the banner's service list only (cvrt-legal 0.10.0+); what the container actually runs is configured in GTM. Replaces both lists as a whole: send [] to empty a category. Only shown while gtm_id is set. | |
| imprint_page | No | Page id of the Impressum page (banner link); 0 = none | |
| privacy_page | No | Page id of the Datenschutz page (banner link); 0 = none |