Download the PHP package itemvirtual/cookies-popup without Composer
On this page you can find all versions of the php package itemvirtual/cookies-popup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download itemvirtual/cookies-popup
More information about itemvirtual/cookies-popup
Files in itemvirtual/cookies-popup
Package cookies-popup
Short Description Cookie consent management for Laravel projects
License MIT
Homepage https://github.com/itemvirtual/cookies-popup
Informations about the package cookies-popup
Cookies popup
Laravel package
This package provides a popup layer to manage cookies consent
Installation
You can install the package via composer:
Publish config file (with --force option to update)
You need to add package cookies name to the EncryptCookies
except array
In laravel 11 you should add the cookies name to the encryptCookies
method in your application's bootstrap/app.php
file
Generate translations
There is a command to create the required translations in labels
section
If you prefer to create the translations in a file, these are the necessary indexes
Usage
Print popup
To add cookie popup, put this code after footer in your html layout
If you set add-inline-styles
to false
in your config/cookies-popup.php
. You should use getHeadStyles()
inside your <head>
html tag
To add a link to open the cookie popup, use the id cookies-popup-show
parameter
Check if cookies are allowed
To hide or show content related with the cookies consent, use the allowed
methods
Add Google Analytics scripts
To add the scripts in your layout (gtag.js
or analytics.js
), use the method you need ()
You need to add an env variable GA_MEASUREMENT_ID
it can be a comma separated array
The analytics.js
script can be normal or async
script more info
analytics.js
Universal Analytics (gtag.js)
Styling
To styling your pop-up window, you have two options.
The custom_styles
or custom_classes
config parameters.
With custom_styles
you can change some CSS styles. If you need a deeper design change,
use custom_classes
, which will concatenate your class to the generic one
Documentation links
Google Consent Mode
Cómo configurar el modo de consentimiento en sitios web
Cómo solucionar problemas del modo de consentimiento con Tag Assistant
Tag Manager consent mode support
Google Tag Assistant
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Sergio
- Itemvirtual
- All Contributors
License
The MIT License (MIT). Please see License File for more information.