Introduction to TermsFeedCookie Consent
What is TermsFeed Cookie Consent?
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.
Key features of TermsFeed Cookie Consent
- 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.
Who needs Cookie Consent solution
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
- Banner display: When users first visit your websitesite, they see a cookie consent banner.
- User choice: Users can accept all, reject all, or customize their preferences.
- Script management: Based on user consent, tagged scripts are loaded or blocked.
- Preference storage: User preferences are saved in a cookie for future visits.
- Preferences Center: Users can change their preferences at any time.
Consent Types
TermsFeed Cookie Consent supports 2 consent modes:
|
Implied Consent
|
|
|
Express Consent (Recommended)
|
|
Cookie Categories
Scripts are organized into 4 categories:
- Strictly Necessary. Essential for website functionality (always allowed).
- Functionality. Enhance user experience (e.g., language preferences).
- Tracking. Analytics and performance measurement (e.g., Google Analytics).
- Targeting. Marketing and advertising (e.g., Facebook Pixel).
Quick Start Guide
Get TermsFeed Cookie Consent running on your website in 5 easy steps.
Step 1: Load the TermsFeed Cookie Consent
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:
- Changing
type="text/javascript"totype="text/plain" - 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
- Clear your browser cookies for your website.
- Reload the page. You should see the consent banner.
- Check your browser Developer Console for any errors.
- Test the script blocking functionality:
- Before accepting: Tagged scripts should NOT load
- After accepting: Tagged scripts should load
- Test the Change Your Preferences button: Click the button to verify that it opens the Preferences Center.
Common mistakes when implementing TermsFeed Cookie Consent
- Forgetting to change script type to
text/plain - Missing the
data-cookie-consentattribute - Not including
page_load_consent_levelswith only "strictly-necessary" - Button ID doesn't match
open_preferences_center_selector - Removing the required credits noscript tag