Download the PHP package jordanbeattie/craftcms-cookie-consent without Composer
On this page you can find all versions of the php package jordanbeattie/craftcms-cookie-consent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jordanbeattie/craftcms-cookie-consent
More information about jordanbeattie/craftcms-cookie-consent
Files in jordanbeattie/craftcms-cookie-consent
Package craftcms-cookie-consent
Short Description Consent manager for Google Tag Manager
License MIT
Informations about the package craftcms-cookie-consent
Cookie Consent
This plugin will add a popup to the bottom-right of the page informing users that the website uses cookies and allows them to enable/disable advertisement and analytics cookies.
Requirements
The project must be using AlpineJS, TailwindCSS and CraftCMS.
Installation
Add the below hook to your <head>
element.
Add the following to your tailwind.config.js
Customisation
Style
You can use the following IDs to target individual elements in the popup
CookieConsent
CookieConsent__Wrapper
CookieConsent__DefaultContent
CookieConsent__Headline
CookieConsent__Copy
CookieConsent__Buttons
CookieConsent__AcceptButtons
CookieConsent__AcceptButton
CookieConsent__NecessaryOnlyButton
CookieConsent__Moreutton
CookieConsent__DetailContent
CookieConsent__Options
CookieConsent__Necessary
CookieConsent__Analytics
CookieConsent__Advertisement
CookieConsent__PolicyLink
CookieConsent__DetailButtons
CookieConsent__SubmitButton
CookieConsent__LessButton
Content
The majority of the content within the popup can be customised via a config file. Running the below command will create a coookie-consent.php
file in your config
directory which you can customise.
Usage
In your Twig templates, you can use the following function to check whether a user has accepted analytics or advertisement cookies.