TermsFeed Free Cookie Consent (latest version 4.2) is a free, open-source JavaScript-based cookie management solution that helps websites comply with the EU Cookies Directive, GDPR, and ePrivacy Directive.

TermsFeed Free Cookie Consent provides a customizable notice banner and preferences center that allows users to control which cookies and scripts run on your website.

  • 100% free. No hidden costs or premium tiers.
  • GDPR & ePrivacy compliant. Built to meet EU privacy requirements.
  • Google Consent Mode V2 Support. Seamlessly integrates with Google's consent requirements.
  • Microsoft UET Consent Mode. Compatible with Microsoft Advertising consent standards.
  • Scripts blocking. It prevents scripts from loading until consent is granted.
  • Customizable design. Choose from multiple banner types and color palettes; additional custom CSS can be applied.
  • Multi-language support.. Available in multiple languages.
  • Callbacks available.. Extensive API for custom integrations.

You need a Cookie Consent solution if:

  • You use Google Analytics or similar analytics or tracking tools
  • You have embedded social media widgets
  • You use advertising pixels (Facebook, LinkedIn, etc.)
  • Your website stores or retrieves any cookies beyond strictly necessary ones (i.e. login, auth)
  • You have visitors from the EU/EEA region

How it works

  1. Banner display: When users first visit your websitesite, they see a cookie consent banner.
  2. User choice: Users can accept all, reject all, or customize their preferences.
  3. Script management: Based on user consent, tagged scripts are loaded or blocked.
  4. Preference storage: User preferences are saved in a cookie for future visits.
  5. Preferences Center: Users can change their preferences at any time.

TermsFeed Cookie Consent supports 2 consent modes:

Implied Consent

  • All scripts load immediately on page load.
  • Assumes consent by continued browsing.
  • Less compliant with GDPR.
  • Use only for non-EU audiences.
Implied consent

Express Consent (Recommended)

  • Scripts are blocked until users explicitly accept.
  • Only "strictly-necessary" scripts load by default.
  • GDPR-compliant approach.
  • Requires active user consent.
Express consent

Scripts are organized into 4 categories:

  1. Strictly Necessary. Essential for website functionality (always allowed).
  2. Functionality. Enhance user experience (e.g., language preferences).
  3. Tracking. Analytics and performance measurement (e.g., Google Analytics).
  4. Targeting. Marketing and advertising (e.g., Facebook Pixel).

Quick Start Guide

Get TermsFeed Cookie Consent running on your website in 5 easy steps.

Add the Cookie Consent JavaScript file to your website.

<script type="text/javascript" src="//www.termsfeed.com/public/cookie-consent/4.2.0/cookie-consent.js" charset="UTF-8"></script>

Step 2: Add the configuration code

Add the configuration script immediately after the Cookie Consent script:

<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
    cookieconsent.run({
        "notice_banner_type": "headline",
        "consent_type": "express",
        "palette": "light",
        "language": "en",
        "website_name": "Your Website Name",
        "website_privacy_policy_url": "https://yourwebsite.com/privacy",
        "open_preferences_center_selector": "#changePreferences",
        "page_load_consent_levels": ["strictly-necessary"]
    });
});
</script>

Step 3: Add the credits line (required)

Include the noscript credits tag (required by our license):

<noscript>Free cookie consent management tool by <a href="https://www.termsfeed.com/">TermsFeed</a></noscript>

Step 4: Add the Change Your Preferences button

Create a button or link that users can click to change their preferences:

<button id="changePreferences">Change Cookie Preferences</button>

The ID must match the open_preferences_center_selector in your configuration.

Step 5: Tag your third-party vendor scripts

Modify existing scripts to respect user consent by:

  1. Changing type="text/javascript" to type="text/plain"
  2. Adding data-cookie-consent="CATEGORY" attribute

Example: Google Analytics

Before:

<script type="text/javascript">
  // Google Analytics code
</script>

After:

<script type="text/plain" data-cookie-consent="tracking">
  // Google Analytics code
</script>

Complete Example

<!DOCTYPE html>
<html>
<head>
    <title>My Website</title>
</head>
<body>

    <!-- Page content here -->

    <!-- Cookie Consent by TermsFeed -->
    <script type="text/javascript" src="//www.termsfeed.com/public/cookie-consent/4.2.0/cookie-consent.js" charset="UTF-8"></script>
    <script type="text/javascript">
    document.addEventListener('DOMContentLoaded', function () {
        cookieconsent.run({
            "notice_banner_type": "headline",
            "consent_type": "express",
            "palette": "light",
            "language": "en",
            "website_name": "My Website",
            "website_privacy_policy_url": "https://mywebsite.com/privacy",
            "open_preferences_center_selector": "#changePreferences",
            "page_load_consent_levels": ["strictly-necessary"]
        });
    });
    </script>
    <noscript>Free cookie consent management tool by <a href="https://www.termsfeed.com/">TermsFeed</a></noscript>
    <!-- End Cookie Consent -->

    <!-- Button to change preferences -->
    <button id="changePreferences">Cookie Settings</button>

    <!-- Tagged Google Analytics -->
    <script type="text/plain" data-cookie-consent="tracking">
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    ga('create', 'UA-XXXXX-Y', 'auto');
    ga('send', 'pageview');
    </script>

</body>
</html>

Testing your implementation

  1. Clear your browser cookies for your website.
  2. Reload the page. You should see the consent banner.
  3. Check your browser Developer Console for any errors.
  4. Test the script blocking functionality:
    1. Before accepting: Tagged scripts should NOT load
    2. After accepting: Tagged scripts should load
  5. Test the Change Your Preferences button: Click the button to verify that it opens the Preferences Center.
  • Forgetting to change script type to text/plain
  • Missing the data-cookie-consent attribute
  • Not including page_load_consent_levels with only "strictly-necessary"
  • Button ID doesn't match open_preferences_center_selector
  • Removing the required credits noscript tag