Cookie compliance integration for Drupal 8
Cookie compliance integration for Drupal 8
To install the CookieScript cookie banner code on Drupal 8, perform the following steps:
Go to your Cookie-Script.com account > Settings > Install:
Configure geo-targeting (if needed).
Download the CookieScript js file from the Installation section. If you need, read more about self-hosting of js files.
Open your Drupal asset library's theme-name.libraries.yml file in your theme folder.
Under js: line, paste the CookieScript file location (file path) as shown below, where your-cookie-script-hash-number.js is your downloaded CookieScript js file.
# theme-name.libraries.yml global-styling: version: 1.x css: theme: global-scripts: version: 1.x js: js/your-cookie-script-hash-number.js: {}
CookieScript is installed on Drupal 8 now and should be ready for use.
Note: If the banner doesn’t appear after the implementation, check if you don’t use any Cache plugin or extension, which prevents the banner from popping-up.
Did this answer your question?