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

Option A: Direct Script

  1. Copy your PUBLIC_BANNER_ID from the CookieBeam dashboard.
  2. 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.

  1. Download the template from GitHub or search "CookieBeam" in GTM Gallery.
  2. Import the template and create a new tag.
  3. Set your Banner ID and use the "Consent Initialization" trigger.