WordPress, Shopify and Tag Manager
The snippet is plain HTML, so it works with any website. What matters is that it ends up first in <head>.
WordPress
Section titled “WordPress”- With a plugin that adds code to the header (for example a “header and footer scripts” plugin), paste the snippet into the header box and give it the highest priority.
- Or, in a child theme, place it in
header.phpright after<head>.
Caching and optimisation plugins can move or delay scripts. Exclude cb.min.js from “defer”, “delay JavaScript” and “combine” options.
Shopify
Section titled “Shopify”In Online Store → Themes → Edit code, open layout/theme.liquid and paste the snippet right after <head>.
Other site builders
Section titled “Other site builders”Use the option for custom code in the head of all pages. If the builder only allows code in the body or in a “footer”, the banner still works, but tags above it may run before consent.
Google Tag Manager
Section titled “Google Tag Manager”Load CookieDoo outside Tag Manager, directly in the page, above the Tag Manager snippet. Then:
- Google tags (GA4, Google Ads) follow Consent Mode v2 on their own. CookieDoo sets these defaults before they load:
ad_storage,ad_user_data,ad_personalization,analytics_storageandpersonalization_storagedenied;functionality_storageandsecurity_storagegranted. When the visitor chooses, it sends an update. - Other tags can use the event that CookieDoo pushes to the
dataLayerafter every choice:
| dataLayer key | Value |
|---|---|
event |
cookiedoo_consent_update |
cookiedoo_necessary |
always true |
cookiedoo_preferences |
true / false |
cookiedoo_statistics |
true / false |
cookiedoo_marketing |
true / false |
Create Data Layer Variables for the cookiedoo_* keys and a Custom Event trigger on cookiedoo_consent_update, and fire each tag only when its category is true.
Meta Pixel
Section titled “Meta Pixel”If the Pixel is already on the page when CookieDoo starts, CookieDoo calls fbq('consent', 'revoke') at load and fbq('consent', 'grant') once marketing is allowed.