Install CookieBeam
Choose the method that fits your stack. CookieBeam supports direct script embeds and a Google Tag Manager (GTM) template. Both initialize Google Consent Mode v2 correctly.
Before you start
- Sign up and create a banner to get your PUBLIC_BANNER_ID.
- Make sure your site allows loading scripts from cdn.cookiebeam.com.
- Publish changes to production when you’re ready.
Option A: Direct Script
- Copy your PUBLIC_BANNER_ID from the CookieBeam dashboard.
- Paste the script near the end of <head> or before </body>.
<script src="https://cdn.cookiebeam.com/api/cdn/banner/PUBLIC_BANNER_ID/loader.js" defer ></script>
This loader sets Consent Mode defaults early and updates consent states after users interact with the banner.
Option B: Google Tag Manager
Use our official GTM template for the easiest setup with full Consent Mode v2 support, Microsoft Clarity integration, and regional consent defaults.
- Download the template from GitHub or search "CookieBeam" in GTM Gallery.
- Import the template and create a new tag.
- Set your Banner ID and use the "Consent Initialization" trigger.