Standard (bottom-right)
Default banner in the bottom-right corner.
https://your-domain.com/cookie-consent.jsLeft-side (chat-friendly)
Same features, bottom-left — avoids live chat widgets on the right.
https://your-domain.com/cookie-consent-left.jsClient options
Banner position
Live tester
Signals sent to Google / Meta / dataLayer appear here…
Embed snippet
Paste into the client site's header (WPCode, theme header, or a GTM Custom HTML tag).
<!-- Agency Cookie Consent -->
<script>
window.TMD_CONSENT_CONFIG = {
companyName: 'Acme Dental',
privacyUrl: 'https://tmdmktg.com/privacy-policy/',
position: 'bottom-right',
buttonColor: '#2563eb',
themeColor: '#111827'
};
</script>
<script src="https://your-domain.com/cookie-consent.js" defer></script>WordPress header/footer
- Install WPCode (Insert Headers and Footers).
- Code Snippets → Header & Footer → paste the embed snippet into Header.
- Or add it in
functions.php:
add_action('wp_head', function () { ?>
<!-- Agency Cookie Consent -->
<script>
window.TMD_CONSENT_CONFIG = {
companyName: 'Acme Dental',
privacyUrl: 'https://tmdmktg.com/privacy-policy/',
position: 'bottom-right',
buttonColor: '#2563eb',
themeColor: '#111827'
};
</script>
<script src="https://your-domain.com/cookie-consent.js" defer></script>
<?php }, 1);Footer reopen button
Any element with this attribute reopens the banner.
<a href="#" data-open-cookie-settings>Cookie Preferences</a> <!-- or via JS --> <button onclick="openCookieSettings()">Cookie Settings</button>
Google Tag Manager setup
- Create a Custom HTML tag with the embed snippet, firing on Consent Initialization – All Pages.
- Create a Custom Event trigger named
cookie_consent_update. - Add Data Layer Variable
consent_status(values:accepted/opted_out). - Ad tags (Google Ads, Meta) respect Consent Mode automatically; for others add an exception trigger where
consent_statusequalsopted_out.
// dataLayer event pushed on load and on every choice
{
event: 'cookie_consent_update',
consent_status: 'opted_out',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'granted'
}
// Listen in custom code
window.addEventListener('tmd_consent_change', e => console.log(e.detail.status));