statikbe / laravel-cookie-consent Goto Github PK
View Code? Open in Web Editor NEWThe package includes a script & styling for a cookie banner and a modal where the visitor can select his/her cookie preferences.
License: MIT License
The package includes a script & styling for a cookie banner and a modal where the visitor can select his/her cookie preferences.
License: MIT License
The user has just validated the modal window of the cookies. He made a mistake and would like to return to it. What is the code or the function that allows to do it in blade (href ?)
Thank
I have implemented the package with GTM for my site but I think I might have a problem in the scenario where a user accepts all cookies but then changes their mind using the adjust preferences link.
Reproduction steps:
Actual behavior:
GA cookies remain and are still set
Expected behavior:
GA cookies are removed and only essential cookies are set
Is this expected or a bug?
I have re-checked that I followed all of the GTM steps as per the documentation:
On page load the CSS and JS files throw a 500 error. The HTML code is visible but display: none;
is always active on it. See image below for reference. (the other 500 errors are just images)
Laravel 9, running in docker.
Installed via composer composer require statikbe/laravel-cookie-consent
Published JS and CSS files as per documentation:
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="public"
Added stylesheet and js script in base blade.
Added as global middleware:
class Kernel extends HttpKernel
{
protected $middleware = [
// ...
\Statikbe\CookieConsent\CookieConsentMiddleware::class,
];
// ...
}
Cookie button snippet added in footer as per documentation:
<a href="javascript:void(0)" class="js-lcc-modal-alert">Cookies prefs</a>
Ran php artisan cache:clear
and php artisan view:clear
Hi,
is it possible to allow website navigation with essential cookies and show banner on every page until the user takes a decision?
I have installed the package and banner shows right but all buttons, menu etc.. on the page is disabled.
I have seen "inert" is added to DOM elements but don't know how to disable that and if there's an option.
I don't want the modal to be shown on certain pages, so I must add the route to ignored_paths array in the config file. For a route as 'admin/users' every thing is fine but for a route as 'admin/user/{id}' it doesn't work. How can I fix it or how can say all the routes which start with '/admin' don't show the cookie policy?
Hi, I have followed the steps in GTM configuration provided here (https://github.com/statikbe/laravel-cookie-consent/blob/master/docs/google-tag-manager.md). But I am not sure of two things:
Any help will be appreciated.
In a few GDPR countries you have to provide a button to Reject All in addition to Accept all, I wanted to customize this myself but I'm not sure it's possible without touching the code itself, could this be a possible feature to be added?
Hi, I see that a tutorial is given for the GTM integration here
Do you have any tutorial how to configure this with Facebook Pixel?
Thanks in advance
Is there a way II can use this to comply this with new Consent mode v2 ?
I have installed the package as per the docs and added a link in the footer to Manage Cookie Preferences.
Cookie Preferences
The modal will not open. The only way I can get the modal to open is by removing my Bootstrap JS. Therefore I assume there is a conflict between the package JS and Bootstrap JS.
I have Googled the issue and see a lot of articles saying that href="javascript:void(0)" should not really be used.
Any ideas what the Bootstrap conflict may be, or is there an alternative way to open the modal rather than using href="javascript:void(0)"?
Thanks in advance.
Local website / Laravel 6.18.25 / PHP 7.4 / jQuery 3.1.1
Package (1.2.0) installed via composer:
composer require statikbe/laravel-cookie-consent
Javascript and css files publication:
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="public"
Added both css/cookie-consent.css & js/cookie-consent.js in the base template file, and web page source code checked for correct files insertion:
<link rel="stylesheet" type="text/css" href="{{asset('vendor/cookie-consent/css/cookie-consent.css')}}">
...
<script src="{{asset('vendor/cookie-consent/js/cookie-consent.js')}}"></script>
Added Statikbe\CookieConsent\CookieConsentMiddleware to app/Http/Kernel.php:
class Kernel extends HttpKernel
{
protected $middleware = [
// ...
\Statikbe\CookieConsent\CookieConsentMiddleware::class,
];
// ...
}
No translation configured ("Customising the dialog texts" and "Customising the dialog contents" steps from the README not used).
cookie-settings snippet placed in the footer, with a hard-coded label:
<a href="#" class="js-lcc-modal-alert">Cookies preferences</a>
Configuration published:
php artisan vendor:publish --provider="Statikbe\CookieConsent\CookieConsentServiceProvider" --tag="config"
Cache cleared:
php artisan cache:clear
php artisan view:clear
And that's all.
Going to the homepage of the website, I only see the grey transparent .lcc-backdrop div.
The two other div (lcc-modal--alert & lcc-modal--settings) are not visible (display: none).
Checking the "__cookie_consent" cookie status: not present.
Reproduced on Chrome, Firefox & Edge.
Notes:
I have installed this. working on my local fine. but getting error 'No hint path defined for [cookie-consent].' on server.
I added this in app/Http/Kerne.php to include it in my entire project: \Statikbe\CookieConsent\CookieConsentMiddleware::class
I started to follow the "How to configure Google Tag Manager" documentation.
I can't understand which GTM screen the step 3 is related to.
The title "Universal Analytics" that I can see in the screenshot is confusing me.
It is not mentioned in the previous steps.
Where does it come from?
After step 2, when I click the "tag" tab as asked in step 3, I can't see anything looking like in the screenshot.
Also, in the screenshot provided in step 3, I can see that the type of "GDPR - Has not given censent" trigger is "Page View".
But in step 2 we created a "GDPR - Has not given censent" trigger of type "Custom Event".
Did I miss something?
By the way, thank you very much for this documentation which seems great!
Is posible to ignore an entire path?, something like all pages under policy/......
and it include policy/en, policy/es, policy/de
For now I am going to export your views.
Just a heads up for now.
I removed this package from my project
Now composer cannot more do dump autoload
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
TypeError
Argument 2 passed to Illuminate\View\Factory::__construct() must be an instance of Illuminate\View\ViewFinderInterface, null given, called in C:\laragon\www\<project name redacted>\vendor\laravel\framework\src\Illuminate\View\ViewServiceProvider.php on line 65
at C:\laragon\www\<project name redacted>\vendor\laravel\framework\src\Illuminate\View\Factory.php:101
97▕ * @param \Illuminate\View\ViewFinderInterface $finder
98▕ * @param \Illuminate\Contracts\Events\Dispatcher $events
99▕ * @return void
100▕ */
➜ 101▕ public function __construct(EngineResolver $engines, ViewFinderInterface $finder, Dispatcher $events)
102▕ {
103▕ $this->finder = $finder;
104▕ $this->events = $events;
105▕ $this->engines = $engines;
1 C:\laragon\www\<project name redacted>\vendor\laravel\framework\src\Illuminate\View\ViewServiceProvider.php:65
Illuminate\View\Factory::__construct(Object(Illuminate\View\Engines\EngineResolver), Object(Illuminate\Events\Dispatcher))
2 C:\laragon\www\<project name redacted>\vendor\laravel\framework\src\Illuminate\View\ViewServiceProvider.php:42
Illuminate\View\ViewServiceProvider::createFactory(Object(Illuminate\View\Engines\EngineResolver), Object(Illuminate\Events\Dispatcher))
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
What damn is this error?!
I rechecked 123 times, my project doesn't include any reference to provider or what else of this package. I deleted middlewares and removed from appserviceprovider
, i removed app/config/
specific file... I removed all views and ensured i do not include these views anymore.
I also did a rm -rf vendor
and a composer clear-cache
. I manually deleted all caches of laravel app, from storage/framework
and from /bootstrap/cache
... I deleted also composer.lock
before retry a composer update
What damn is this error?
The absurd is that if I readd the package, the error disappear. What else should I search in my project!?!?
Just a test to see if slack get triggered.
[Package version: 1.2.1]
I expected the page to be refreshed after cookie consent, but it's not the behavior I observe in my case.
Is not the page supposed to be refreshed when the user gives consent, to immediately take this setting into account?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.