Cookie compliance integration for Wordpress and WooCommerce

Cookie compliance integration for Wordpress and WooCommerce

Nelson
Written by NelsonLast update 17 days ago

There are two ways of installing CookieScript on WordPress (or WooCommerce): with a plugin or by modifying template file. The Plugin is recommended since you will still be able to update your WordPress theme later.

Method 1: Installing CookieScript via WordPress plugin.

To make your job with Cookie-Script snippet easier and more enjoyable we have created a WordPress plugin. All you need to do is install and follow instructions:

1. Download the plugin from https://wordpress.org/plugins/cookie-script-com/ or find it in your Wordpress dashboard: click on Plugins > Add New. Then type your “Cookie-Script.com” into the search box on the top right and then click Install Now:

2. Go to the Plugins Search “Cookie-Script” and click Activate:

3. Go to the Plugins again, and click Settings under “Cookie-Script.com”:

4. Check the box Enable Google Consent Mode, so you can accept or reject different types of cookies for your cookie banner:

5. Finally, you have to copy-paste the script URL from your Cookie-Script.com account:

Method 2: Installing Cookie-Script for WordPress by editing theme files.

  1. Go to your Cookie-Script.com account > Settings > Install:

  2. Configure geo-targeting.

  3. Press the Wordpress tab and copy your CookieScript code.

  4. Log in to your WordPress Admin Dashboard.

  5. Hover Appearance and click on Theme Editor.

  6. Find and click on the header.php template file.

  7. Paste copied Cookie-Script snippet at the beginning of the <body> tag.

  8. Click the Update File button.

CookieScript is installed on WordPress now and should be ready for use.

Note: CookieScript does not block third-party cookies by default. You need to configure your banner settings

first, choosing one of the methods. Read the guide on how to block third-party cookies.

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.  

Common problems:
1. If you have issues with the Cart, add the following cookies to CookieScript cookie declaration as strictly necessary cookies:

2. To fix the "Invalid script detected" issue, ensure you select WordPress in the Banner Settings under Install section. Verify that you copied the generated code specifically for WordPress and use it in Plugin.

Did this answer your question?