PHPackages                             postare/filament-tracking-consent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. postare/filament-tracking-consent

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

postare/filament-tracking-consent
=================================

A FilamentPHP plugin to easily add tracking codes (e.g., Google Analytics) to the frontend, manage related cookies, and display a customizable GDPR consent banner.

v0.1.4(1y ago)012[3 PRs](https://github.com/postare/filament-tracking-consent/pulls)MITPHPPHP ^8.1CI passing

Since Mar 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/postare/filament-tracking-consent)[ Packagist](https://packagist.org/packages/postare/filament-tracking-consent)[ Docs](https://github.com/postare/filament-tracking-consent)[ GitHub Sponsors](https://github.com/postare)[ RSS](/packages/postare-filament-tracking-consent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (11)Versions (6)Used By (0)

Filament Tracking Consent
=========================

[](#filament-tracking-consent)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9a9b9bd90a3120b52d8d6cee6299440357c726d2eec7b78ece4190d2032ee444/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706f73746172652f66696c616d656e742d747261636b696e672d636f6e73656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/postare/filament-tracking-consent)[![Total Downloads](https://camo.githubusercontent.com/571fbf9281db50b5942dd66111e29b225b15092a00ec2902c9700a65f072d9d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706f73746172652f66696c616d656e742d747261636b696e672d636f6e73656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/postare/filament-tracking-consent)

**Filament Tracking Consent** is a Filament plugin that allows you to easily integrate tracking codes (e.g., Google Analytics) into your frontend while ensuring compliance with GDPR and other privacy regulations.

This package includes a **fully customizable cookie consent banner** and provides a structured way to manage tracking scripts based on user preferences.

Features
--------

[](#features)

✅ **GDPR-Compliant Cookie Consent Banner** – Display a customizable banner for users to accept or reject tracking cookies.
✅ **Automatic Script Blocking** – Tracking scripts are only executed once user consent is granted.
✅ **Granular Consent Management** – Users can enable or disable tracking per category (e.g., Analytics, Marketing, Preferences).
✅ **Easy Integration** – Simple Blade components and stack placeholders to include tracking scripts in your layout.
✅ **Fully Configurable** – Modify the banner style, text, and behavior via a Filament Page.
✅ **Supports Multiple Languages** – Easily translate consent messages for multilingual applications.
✅ **Built on CookieConsent.js** – Uses the powerful [CookieConsent](https://github.com/orestbida/cookieconsent) library by Orest Bida for a robust and reliable solution.

Prerequisites
-------------

[](#prerequisites)

This package depends on [DB Config](https://github.com/postare/db-config). Make sure you install it first.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require postare/filament-tracking-consent
```

Publish the configuration file:

```
php artisan vendor:publish --tag="filament-tracking-consent-config"
```

The default configuration file looks like this:

```
return [
    'settings-page' => [
        'title' => 'Tracking Settings',
        'navigation-label' => 'Tracking and Consent',
        'navigation-icon' => 'heroicon-o-presentation-chart-bar',
        'navigation-group' => 'Settings',
    ],
];
```

Registering the Plugin
----------------------

[](#registering-the-plugin)

To enable the plugin, register it inside your Filament panel provider, typically in `app/Providers/Filament/AdminPanelProvider.php`:

```
->plugins([
    ...
    \Postare\FilamentTrackingConsent\FilamentTrackingConsentPlugin::make(),
])
```

Usage
-----

[](#usage)

### Displaying the Consent Banner

[](#displaying-the-consent-banner)

Add the tracking consent component inside your layout file, **just before the closing `` tag**:

```

```

### Injecting Tracking Scripts

[](#injecting-tracking-scripts)

Use these stack placeholders to control where tracking scripts are injected:

- **Immediately after opening ``**:

    ```
    @stack('tracking-consent-body-start')
    ```
- **Just before closing ``**:

    ```
    @stack('tracking-consent-body-end')
    ```

### Cookie Preferences Button

[](#cookie-preferences-button)

To allow users to adjust their cookie preferences after initial selection, place this stack wherever you want the button to appear (e.g., in the footer):

```
@stack('tracking-consent-preferences-btn')
```

JavaScript Dependency
---------------------

[](#javascript-dependency)

This plugin is powered by [CookieConsent.js](https://github.com/orestbida/cookieconsent), an open-source, lightweight, and highly customizable JavaScript library for managing cookie consent.

### Why CookieConsent.js?

[](#why-cookieconsentjs)

- **Fully customizable UI** – Modify the banner design to match your brand.
- **Granular consent control** – Users can enable or disable specific categories of cookies.
- **Automatic script management** – Blocks tracking scripts until consent is given.
- **Multiple language support** – Display consent banners in different languages.
- **Privacy law compliance** – Helps ensure compliance with GDPR, CCPA, and similar regulations.

For advanced customization options, refer to the [CookieConsent documentation](https://github.com/orestbida/cookieconsent).

Credits
-------

[](#credits)

- [Francesco Apruzzese](https://github.com/postare)
- [All Contributors](../../contributors)

License
-------

[](#license)

This package is open-source software licensed under the [MIT License](LICENSE.md).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance71

Regular maintenance activity

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

433d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9951f7bf6251c81aceb7df0a295359cd0d2356543350c6a1a988d4b60f3f981?d=identicon)[inerba](/maintainers/inerba)

---

Top Contributors

[![inerba](https://avatars.githubusercontent.com/u/5882517?v=4)](https://github.com/inerba "inerba (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelpostarefilament-tracking-consent

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/postare-filament-tracking-consent/health.svg)

```
[![Health](https://phpackages.com/badges/postare-filament-tracking-consent/health.svg)](https://phpackages.com/packages/postare-filament-tracking-consent)
```

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[jibaymcs/filament-tour

Bring the power of DriverJs to your Filament panels and start a tour !

12247.8k](/packages/jibaymcs-filament-tour)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

9169.0k4](/packages/marcelweidum-filament-expiration-notice)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[outerweb/filament-settings

Filament integration for the outerweb/settings package

3690.9k4](/packages/outerweb-filament-settings)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
