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.
There are these methods to install PrestaShop:
By using the CookieScript app (for installing PrestaShop 8.0).
Manual installation by copying and pasting the CookieScript banner code manually (for installing PrestaShop 1.7 and other versions that support the code installation)
CookieScript installation with Google Tag Manager (GTM) (for installing all versions, including PrestaShop 8.0 and PrestaShop 1.7).
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 > Install:
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.
Also read the following guides:
How to install CookieScript with Google Tag Manager (GTM)?
How to install Google Consent Mode v2 with GTM?
How to 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 > Install:
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.
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.
Also read the following guides:
How to install CookieScript with Google Tag Manager (GTM)?
How to install Google Consent Mode v2 with GTM?
How to select Basic or Advanced Google Consent Mode implementation at your GTM account?
Did this answer your question?