Includes: Component, Plugin
ConsentLab
A lightweight cookie consent manager for Joomla. GDPR and ePrivacy compliant consent banners with granular category toggles, server-side script blocking, and a consent log — without a SaaS subscription.
About this Extension
ConsentLab is a lightweight cookie consent manager for Joomla 5 & 6. Display a fully compliant GDPR/ePrivacy consent banner with granular category toggles, block scripts until consent is granted, and log every decision server-side. No SaaS subscription, no bloat.
Key Features:
- Cookie Categories — manage cookie categories in the admin with a pre-seeded set: Strictly Necessary, Analytics, Marketing, and Preferences. Add, edit, or remove categories as needed.
- Consent Banner — system plugin injects a consent banner on every frontend page. Choose from five positions: bottom bar, top bar, corner left, corner right, or centre modal.
- Script Blocking — tag third-party scripts with a
data-consentlabattribute and the extension blocks them until the visitor consents to that category. Server-side type-attribute swapping ensures scripts never execute prematurely. - Granular Toggles — visitors choose exactly which categories to accept. Required categories (e.g. Strictly Necessary) are locked on and clearly indicated.
- Consent Logging — every consent decision is logged server-side via AJAX with timestamp, categories accepted, and anonymised IP. Export to CSV or purge old entries from the admin.
- Consent Versioning — bump the consent version number to automatically re-prompt all visitors when your cookie policy changes.
- Shortcode — use
Manage Cookie Preferencesin any article or custom HTML module to render a “Manage Cookie Preferences” link. - JavaScript API — public API on
window.ConsentLabwith methods to show preferences, check consent, and revoke consent programmatically. - Style Options — configure banner colours, button colours, toggle colour, and border radius from the admin. All applied via CSS custom properties for easy template-level overrides.
- Accessible — focus trap in the banner, ARIA roles and labels, full keyboard navigation, and
prefers-reduced-motionsupport. - Lightweight — 8 KB gzipped frontend footprint (CSS + JS). Vanilla CSS and JavaScript with zero third-party dependencies.
How It Works:
- Install the package and the consent banner appears on your site immediately.
- Review the pre-seeded cookie categories in Components → ConsentLab → Cookie Categories.
- Tag any third-party scripts with
data-consentlab="category-alias"to block them until consent is given. - Configure banner position, text, privacy policy link, and style options to match your site.
- Monitor consent decisions in the Consent Log and export as needed for compliance records.
Package Includes:
com_consentlab— admin component with cookie categories CRUD, consent log, and configuration optionsplg_system_consentlab— system plugin for banner injection and script blockingplg_content_consentlab— content plugin for theManage Cookie Preferencesshortcode
Built on Joomla’s native MVC architecture. No external dependencies, no SaaS subscription.
Releases
Add-on support release. ConsentLab now provides hooks that add-ons such as ConsentLab Pro use to extend the banner and the consent log. The banner works as before for sites without add-ons.
Changelog
- Add-on support: other extensions can add details to consent log entries and add banner content or scripts before the page is sent, through two new events (onConsentLabBeforeLog and onConsentLabBeforeInject).
- The consent log stores add-on details in a new Additional Data column, which is included in the CSV export.
- The banner script can be extended by add-ons, for example to share the consent cookie across a domain or control when the banner is shown.
- Includes a small database update that adds one column to the consent log. Existing records are kept.
Compliance and reliability release. Fixes consent logging when IP anonymisation is enabled, makes ConsentLab safe to use with page caching, and deletes cookies when a visitor rejects or withdraws consent.
Changelog
- Fixed: consent logging failed on every request when IP anonymisation was enabled (the 64-character hash did not fit the 45-character column under MySQL strict mode). IPs are now truncated (IPv4 /24, IPv6 /48) instead of hashed, which is also genuine anonymisation
- Fixed: with Joomla's page cache or a full-page cache (LiteSpeed, Cloudflare), one visitor's consent state could be cached and served to others, running tagged scripts without consent. Pages are now identical for every visitor; scripts are always blocked server-side and activated client-side
- Added: cookies listed for a category (with `*` wildcard support) are deleted when the visitor rejects or withdraws consent; withdrawing a previously accepted category reloads the page so its scripts stop
- Added: visitors are re-prompted when a new optional category is published
- Added: optional floating "Cookie settings" button so visitors can withdraw consent from any page
- Added: `consentlab:ready` JavaScript event
- Fixed: keyboard focus trap skipped hidden controls incorrectly and let focus escape; the trap and `aria-modal` now apply only to the centre modal, and focus returns to where it was when the banner closes
- Fixed: category details can now be opened with the keyboard (button with `aria-expanded`); the locked required toggle now has an accessible name
- Changed: default Reject button text colour raised to #334155 for WCAG AA contrast, with a subtle outline so Reject is as prominent as Accept
- Fixed: tagged scripts now activate in document order, waiting for external libraries before dependent inline scripts run; `type="module"` is preserved
- Fixed: `data-src` and `data-type` attributes were mistaken for `src` and `type` when blocking scripts
- Fixed: the banner could be injected twice if `` appeared inside an inline script; a regex failure on very large pages no longer breaks the page
- Fixed: Reject All did not activate scripts tagged with a required category
- Fixed: `ConsentLab.hasConsent()` and `getConsent()` ignored the consent version
- Security: the consent log endpoint now validates the consent ID, action and categories against published categories, and caps the request size
- Security: Purge Expired Entries now checks the Delete permission server-side; CSV export escapes values that spreadsheets would treat as formulas, streams rows instead of loading the whole log into memory, and includes a UTF-8 BOM
- Fixed: purge used the database server's local time against UTC dates
- Added: expired consent log entries are now purged automatically according to Log Retention (Days)
- Fixed: search, action filter and sort options were not shown in the Consent Log and Cookie Categories views
- Fixed: category aliases are now sanitised and must be unique
- Fixed: the search fields in both filter forms used `layout="joomla.searchtools.default"`, which made the search tools render themselves recursively ("Call to a member function getGroup() on null") once the filters were shown
- Fixed: the Cookie Categories sort list showed the raw constant JFIELD_ORDERING_ASC (and a field description for descending); it now uses Joomla's Ordering ascending/descending labels
- Fixed: saving a new cookie category failed on MariaDB and MySQL 8 because the `created` column default was inserted as the literal text `current_timestamp()`
- Fixed: the consent log endpoint's JSON headers and status codes were never sent
- Changed: a crypto-strength random generator is used for consent IDs
- Documentation: corrected the CSS class and custom property reference and the JavaScript API examples; documented events and caching behaviour
Fixes
Translation maintenance release ensuring remaining user-facing labels and accessibility text can be localised cleanly.
Changelog
- Translation: moved the consent dialog accessibility label into the system plugin language file
- Translation: replaced the hard-coded consent log action filter placeholder with a Joomla language string
- Changed: frontend default title and description handling now respects translated language values while preserving existing English saved defaults
- Fixed: corrected Joomla singular/plural item message mappings for category publish, unpublish, trash, and delete actions
Bug-fix release restoring the shortcode preferences controls for returning visitors.
Changelog
- Fixed: {consentlab manage} opened the preferences panel without functional controls when a valid consent cookie already existed
- Fixed: banner event registration is now idempotent when the public API initialises before the normal page boot
- Changed: the injected frontend script URL now includes a file-version cache key so upgrades load the corrected JavaScript immediately
What's New
Display customisation release adding finer control over the banner title and styling hooks.
Changelog
- Added: option to hide the visible banner title while retaining its accessible label
- Added: sanitized custom CSS classes for the banner container
Description
Maintenance release fixing CSV export from the consent log.
Changelog
- Fixed: CSV export validated the CSRF token as a GET parameter even though the Joomla toolbar submits the export action and token via POST
- Clarified: the purge button and result message now identify that only entries older than the configured retention period are removed
- Translation: moved remaining interface, settings, filter, CSV heading, validation, menu, and frontend banner strings into Joomla language files
Initial release of ConsentLab, a lightweight cookie consent manager for Joomla 5 and 6. GDPR and ePrivacy compliant consent banners with granular category toggles, server-side script blocking, and a full consent log.
Changelog
- Cookie categories CRUD with pre-seeded set: Strictly Necessary, Analytics, Marketing, Preferences
- System plugin injects consent banner on every frontend page
- Five banner positions: bottom bar, top bar, corner left, corner right, centre modal
- Granular category toggles with required/locked categories
- Server-side script blocking via data-consentlab attribute and type-attribute swapping
- Client-side script activation on consent grant
- Consent stored in first-party cookie with JSON payload
- Server-side consent logging via AJAX with anonymised IP
- Consent log admin view with CSV export and purge
- Consent version bumping to re-prompt all visitors on policy changes
- Content plugin for {consentlab manage} shortcode
- Public JavaScript API: ConsentLab.showPreferences(), .hasConsent(), .getConsent(), .revokeConsent()
- Configurable banner position, title, description, and privacy policy URL
- Show/hide reject all button and category details toggle
- Consent expiry and log retention day settings
- IP anonymisation option
- Style options: banner colours, button colours, toggle colour, border radius
- CSS custom properties for template-level style overrides
- Accessible: focus trap, ARIA roles, keyboard navigation, prefers-reduced-motion
- 5.7 KB gzipped frontend footprint (CSS + JS)
- Vanilla CSS and JavaScript with zero third-party dependencies
- Joomla 5 and 6 compatible