Cookie compliance integration for PrestaShop 8.0 and 1.7
Cookie compliance integration for PrestaShop 8.0 and 1.7
You can install the CookieScript module on PrestaShop 8.0, PrestaShop 1.7, and other versions.
To install PrestaShop 8.0, use the CookieScript app.
To install PrestaShop 1.7 and other versions that support the code installation, you need to copy and paste the CookieScript banner code manually.
See the details below.
I. Cookie compliance integration for PrestaShop 8.0
To install and configure the CookieScript module on PrestaShop 8.0, perform the following steps:
Register at CookieScript.
Go to your Cookie-Script.com account > Settings > Installation.
Configure geo-targeting (if needed).
Copy your item's src attribute's value (i.e. the file URL) from your CookieScript code.
Then, go to PrestaShop and download the CookieScript module.
Go to the Settings tab, found at the bottom-left side of the PrestaShop account, and paste your item's src attribute's value from your CookieScript account:
Enable Google Consent Mode v2 by checking the checkbox:
Once enabled, you can control the settings of Google Consent Mode separately.Lastly, configure regional settings by pressing the Add new region tab and save changes by pressing the tab Save:
The CookieScript module is turned on. If you want to turn off the module temporarily, press the tab Unpublish.
That’s all, you have installed and configured your CookieScript cookie banner module on PrestaShop 8.0.
Once you enabled Google Consent Mode v2 on PrestaShop 8.0, you can now select Basic or Advanced Google Consent Mode implementation at your GTM account.
II. Cookie compliance integration for PrestaShop 1.7 and other versions that support the code installation
To install and configure the CookieScript module on PrestaShop 1.7, perform the following steps:
Register at CookieScript.
Go to your Cookie-Script.com account > Settings > Installation.
Configure geo-targeting (if needed).
Copy your item's src attribute's value (i.e. the file URL) from your CookieScript code.
Then, go to PrestaShop and istall the CookieScript snippet manually.
Open to {project_directory}/classes/controller/FrontController.php file
Go to setMedia() function
Add the following code, where your-file-URL is your item's src attribute value.
$this->registerJavascript( 'remote-bootstrap', 'your-file-URL', ['server' => 'remote', 'position' => 'head', 'priority' => 20] );
There are 2 positions where you can set your CookieScript file:
1 - top of the page (inside <header>) by setting the position to top like this ‘position’ => ‘top’
2 - the end of the tag <body> by ‘position’ => ‘bottom’
CookieScript is installed on PrestaShop 1.7 now and should be ready for use.
Once you enabled Google Consent Mode v2 on PrestaShop 1.7, you can now select Basic or Advanced Google Consent Mode implementation at your GTM account.
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?