Turn On Google Consent Mode v2 with Cookiebot and AI
Google Consent Mode v2 on in Cookiebot, its default-denied script on your page, and checked against every Google tag.
Prerequisites
A site connected to WPVibe running Cookiebot by Usercentrics 4.7 or newer (tested on 4.8.1, free) on WordPress 6.9 or newer, with an administrator account, and a Cookiebot or Usercentrics account for the banner itself.
My WordPress site uses the Cookiebot by Usercentrics plugin and [Google Analytics, Google Ads or Google Tag Manager]. Make sure Google Consent Mode v2 is on and set before my Google tags load. 1. Run discover_abilities with category cookiebot. If the cookiebot abilities this needs are not there, stop and tell me to install or update the free Cookiebot by Usercentrics plugin from WordPress.org (4.7 or newer, on WordPress 6.9 or newer). 2. Never run cookiebot/toggle-gcm with enabled false in this job. Run cookiebot/get-status. If cbid_set is false, stop and tell me to connect my Cookiebot or Usercentrics ID first: until an ID is set, the plugin adds no Consent Mode script. If banner_enabled is false, stop and tell me the banner is switched off: Consent Mode would set every visitor to denied with no banner to update it, so ads and analytics would lose them. Run run_wp_cli with option get cookiebot-cbid. If option get comes back empty or not found while cbid_set is true, the ID is set for the whole multisite network: read it from the banner script on my home page (get_page_html, url set to my home page's address) and tell me it is set network-wide. A Cookiebot Domain Group ID is 36 characters: letters a to f (in any case) and digits in groups of 8, 4, 4, 4 and 12, joined by dashes. A Usercentrics Settings ID is 9 or 14 characters: letters, digits, underscores or dashes. If it is a Domain Group ID with any capital letters, stop and tell me to save it again in lowercase first: the plugin loads the Usercentrics banner for it. Cookiebot's Google Consent Mode script is a gtag consent default call with ad_storage, ad_user_data, ad_personalization, analytics_storage, functionality_storage and personalization_storage denied, security_storage granted and wait_for_update 500, followed by a gtag set ads_data_redaction line. If more than one consent default call is on the page, list each, which plugin likely adds it, and which comes first. If Cookiebot's has type text/plain instead of text/javascript, tell me its defaults only run after a visitor consents, which happens in manual blocking mode with Consent Mode cookie categories chosen. 3. If gcm_enabled is false, read my home page with get_page_html first, url set to my home page's address. For a Domain Group ID, the banner script is the script with id Cookiebot loading from consent.cookiebot.com, and its data-cbid must be the ID. For a Settings ID, it is the script with id usercentrics-cmp, and its data-settings-id, or data-ruleset-id, must be the ID. If the banner script is missing or wrong, stop and tell me what you found: Consent Mode without a working banner leaves every visitor at denied. If a consent default call that is not Cookiebot's is already there, tell me and ask before going on. If the page loads gtm.js, other than the Tag Manager loader Cookiebot adds itself right after its Consent Mode script, tell me Consent Mode may already be set inside my Tag Manager container, and ask before going on. Then tell me you are turning Consent Mode on, run cookiebot/toggle-gcm with enabled true, confirm new_value is true, then run run_wp_cli with cache purge so visitors get the change. If it is already on, change nothing. 4. Read my home page with get_page_html, url set to my home page's address (again, if you read it in step 3). A Google tag is a script whose src, or whose inline code, loads from googletagmanager.com, google-analytics.com or googleadservices.com (gtag/js, gtm.js, analytics.js). Tag Manager snippets pasted into the theme are inline code with no src. Judge the order only from tags written in the page source. get_page_html normally reads the page as the server sends it, but it can fall back to a headless browser render in which scripts have run and added tags. Treat the read as a render, and say the order and script types cannot be judged from it, if it has a script loading cc.js from consent.cookiebot.com, a script or link loading from web.cmp.usercentrics.eu/ui/v/, or a script with a src loading gtm.js (Cookiebot and the usual Tag Manager snippets add these in the browser), or WordPress's own scripts, such as jquery, with type text/plain (the Usercentrics autoblocker rewrites them in the browser), or if the cookie banner's own text or buttons appear in the page. Otherwise judge every tag as written, including a gtag/js script at the very top of the head. If the read is cut short, read on with offset until the end of the head tag; a Google tag after the head tag comes after the Consent Mode script. A Google tag with type text/plain and a data-cookieconsent attribute waits for consent (Cookiebot rewrites some plugins' tags this way): list it, but don't call it a problem. Find Cookiebot's Consent Mode script and every Google tag, and tell me whether the Consent Mode script comes before each one. Also check the banner script is on the page (For a Domain Group ID, the banner script is the script with id Cookiebot loading from consent.cookiebot.com, and its data-cbid must be the ID. For a Settings ID, it is the script with id usercentrics-cmp, and its data-settings-id, or data-ruleset-id, must be the ID.). If it is missing, tell me: Consent Mode without a working banner leaves every visitor at denied, so the job is not done. If a Google tag comes first, tell me it loads before the consent defaults are set, and which plugin or theme likely adds it if the page shows it. Don't move or remove it: ask me. 5. If the Consent Mode script is missing while gcm_enabled is true, tell me what the page shows instead, and change nothing more. 6. Never use cookiebot/toggle-gcm to turn Consent Mode off: it leaves the Consent Mode script on the page while the settings say off. If I ask for Consent Mode off, tell me to turn it off under Cookiebot, Settings, Google Consent Mode (not with the toggle on Cookiebot's dashboard) and save that screen; its switch may already look off. Then check the banner still shows. The dashboard toggle leaves the script in place too. 7. Report Consent Mode before and after, and the order of the scripts on the page. Then tell me to open my site in a private window, accept on the banner, and check with Google's Tag Assistant that consent changes to granted: this check can't see what happens after a visitor chooses.
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Turn On Google Consent Mode v2 with Cookiebot and AI” recipe from the WPVibe cookbook on my connected site.
If you run Google Ads or Analytics for visitors in the EU, Google Consent Mode is how your banner tells Google what each visitor agreed to. Cookiebot calls Consent Mode v2 required for Google Ads and Analytics in the EU and EEA. It is on by default, but a switch turned off long ago, or a Google tag that loads ahead of it, means Google gets no consent signal before your tags run.
The AI checks Cookiebot’s status, turns Consent Mode on if it is off, then reads your home page to confirm the Consent Mode script is there with ad and analytics storage denied by default, and that it comes before every Google tag. If a tag loads first, it tells you which and asks before touching anything.
Consent Mode needs your Cookiebot or Usercentrics ID connected first: with no ID, the plugin adds nothing to the page. Don’t ask the AI to turn Consent Mode off: its off setting, like the toggle on Cookiebot’s dashboard, leaves the script on the page. Switch it off under Cookiebot, Settings, Google Consent Mode and save that screen. If you add Google tags with GTM4WP, also see this recipe.
Outcome
Consent Mode is on, its script is on your home page, and you know whether any Google tag loads before it.