TermsBox
PricingBlog
LoginGet Started
PricingBlogLogin
Get Started
  1. Home
  2. Install guides
  3. HTML

Install the TermsBox cookie banner on a plain HTML website

This guide is for websites made of plain HTML files (for example, files named index.html, about.html, and so on), whether you edit them by hand or through a simple host. It walks you through adding one small script tag so the TermsBox consent banner appears on your pages.

Total time: about 5 minutes.


What you need

  1. Your site id. This is a short code that connects the banner to your account. You do not type it in by itself. Instead, you copy a ready made snippet that already has your site id inside it.

  2. Where to get it. Log in to TermsBox and open the dashboard.

    • Go to Consent Banner, then open the Install tab. This is the main place to find your snippet.
    • You can also find it during the initial setup steps right after you create your site, on the Getting Started card on your dashboard home, and on the success page right after checkout.
    • Note: the snippet is not under Settings. If you look there and cannot find it, go to Consent Banner instead.

The dashboard never shows your site id as a bare code on its own. It is always shown inside the full snippet, ready to copy.


The snippet you will paste

In the dashboard, click the copy button next to the snippet. It looks like this, but with your real site id already filled in where you see YOUR_SITE_KEY:

<script src="https://termsbox.com/cmp/termsbox-cmp.js" data-site-id="YOUR_SITE_KEY" data-auto-block="on"></script>

Important: always copy the snippet from your dashboard so your real site id is included. If you copy the example above by hand, the banner will not work, because YOUR_SITE_KEY is only a placeholder.

Two quick notes about this snippet:

  • Do not add async or defer to the tag. The script needs to run right away, before your other scripts. Adding async or defer will stop it from working correctly.
  • Keep the whole tag on one line and do not change the address. The web address inside src tells the banner where to load its settings from. If you change it, the banner cannot find your settings.

Where to place it

The snippet goes inside the <head> section of your pages, near the top. Every HTML page has a <head> section that starts with <head> and ends with </head>.

Place the snippet just before the closing </head> tag.

The banner must be on every page of your site where you want it to appear. How you do that depends on how your site is built.

Option A: If your pages share one header file (recommended)

Many hand built sites keep the top part of every page in a single shared file, sometimes called a header include, a partial, or a template. Common names are header.html, head.html, or a PHP include like header.php.

  1. Open your shared header file.
  2. Find the </head> tag.
  3. Paste the snippet on its own line, just before </head>.
  4. Save the file.

Because every page pulls in this one shared file, the banner now appears on all of them. This is the cleanest approach.

Option B: If each page is a separate file with its own head

If your pages do not share a header, you must add the snippet to each page by hand.

  1. Open one of your HTML files (for example index.html).

  2. Find the </head> tag near the top of the file.

  3. Paste the snippet on its own line, just before </head>. For example:

    <head>
      <meta charset="utf-8" />
      <title>My Website</title>
      <script src="https://termsbox.com/cmp/termsbox-cmp.js" data-site-id="YOUR_SITE_KEY" data-auto-block="on"></script>
    </head>
  4. Save the file.

  5. Repeat for every HTML page on your site (for example about.html, contact.html, and so on).

  6. Upload the changed files to your web host if your site is not edited directly on the server.


Verify it works

Do these two checks after you have added the snippet and published your site.

Check 1: Look at your live site.

  1. Open your website in a normal browser tab, using its real public web address.
  2. Reload the page.
  3. Within a second or two you should see the cookie consent banner appear.

Tip: if you have visited your site before and already made a cookie choice, the banner may not show again. Open a private or incognito window and load your site there to see it as a new visitor would.

Check 2: Use the dashboard verify button.

  1. Go back to the TermsBox dashboard, Consent Banner, then the Install tab.
  2. Click Verify Installation.
  3. TermsBox visits your site's main web address and checks that the script tag is present. If it finds it, the status changes to verified.

Note: the verify button checks the main address stored for your site (usually your homepage). If your homepage is behind a login, or your host blocks automated visitors, this check may say "not found" even though the banner is actually working. In that case, trust Check 1 (seeing the banner on your live site) as the real proof.


Troubleshooting

The banner does not appear at all.

  • Make sure you copied the snippet from your dashboard, so it contains your real site id. A missing or empty site id causes a silent failure: no banner and no error message.
  • Confirm the snippet is inside the <head> section, before </head>, and not somewhere else in the page.
  • Make sure you actually saved and published or uploaded the changed file.
  • Check that you did not accidentally add async or defer to the tag.

The banner appears on some pages but not others.

  • Those other pages do not have the snippet. If you are adding it page by page, add it to each page's <head>. Using a single shared header file (Option A above) avoids this.

I made a cookie choice and now the banner is gone.

  • This is normal. The banner remembers your choice. To see it again, open a private or incognito window, or clear your site cookies.

The dashboard verify button says it cannot find the script, but I can see the banner.

  • Your host may be blocking the automated check, or your main address may be behind a login or redirect. If you can see the banner on your live site in a private window, your install is working. You can move on.

I want the banner text or links to change.

  • All banner appearance and content settings live in your TermsBox dashboard. You do not edit the snippet for that. Change the settings in the dashboard and they take effect on your site automatically.
View install guides for all platforms
TermsBox

Scan your website, auto-generate legal documents, add a consent banner, and stay compliant. One platform for everything.

Product

  • Cookie Scanner
  • Consent Banner
  • Cookie Policy Generator
  • Pricing

Generators

  • Privacy Policy Generator
  • Terms and Conditions Generator
  • EULA Generator
  • Disclaimer Generator
  • Return and Refund Policy Generator

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
GDPR
ePrivacy
CCPA
LGPD
Google Consent Mode v2
IAB TCF 2.2
© 2026 TermsBox. All rights reserved.