in ,

How to Host Analytics.js Locally with CAOS and Cookie Notice for GDPR

Configure CAOS with Cookie Notice for GDPR

CAOS for Analytics has been around for a few years now, bathing in all of the glory it accumulated by hosting analytics.js locally. About two months ago, our lives are enriched by the new GDPR laws. For me, it meant getting back to work and make sure CAOS for Analytics is GDPR compliant as well. I’ve introduced many changes since then. One of the major new features though, is complete compatibility with other Cookie Notice plugins for WordPress. By far the most popular is Cookie Notice for GDPR. Today I will show you how to configure CAOS to work with this plugin. So you can host analytics.js locally and be GDPR compliant at the same time!

How to Configure CAOS to be GDPR Compliant with Cookie Notice for GDPR

Not using Cookie Notice for GDPR? Click here to add the power of CAOS to GDPR Cookie Consent

After following the steps below, your WordPress-blog will abide to the new laws enforced by the GDPR. Your Google Analytics-tracking scripts will still be locally hosted so you can have the best of both worlds. Follow the rules and maintain your high score on Pingdom and Google Pagespeed. Let’s get started!

Enabling the Cookie Notice

The Cookie Notice will not be provided by CAOS for Analytics, but by ‘Cookie Notice for GDPR’: by far the most downloaded Cookie Notice plugin in the WordPress repository.

If you’re already using Cookie Notice for GDPR and want to combine it with CAOS for Analytics, you can skip to the next chapter. Otherwise continue with the steps below.

Installing the plugin into your WordPress environment is easy:

How to configure CAOS and host Analytics Locally with Cookie Notice for GDPR
How to configure CAOS and host Analytics Locally with Cookie Notice for GDPR
  1. Open the ‘Plugins‘ menu and click ‘Add new‘.
  2. In the next screen that opens, search for ‘Cookie Notice for GDPR‘.
  3. The plugin will show at the top of the search results. Click ‘install now‘.
  4. After it’s finished downloading, click ‘activate‘.

A new menu-item will be added to your Settings-menu, called ‘Cookie Notice‘. Go there to configure the cookie notice’s visuals and functioning.

Once your done, you can continue to configure CAOS for Analytics for full compatibility with Cookie Notice for GDPR.

Configuring CAOS for Analytics with Cookie Notice for GDPR

Now all that’s left to do is tell CAOS to check for the cookie created by the plugin. If you haven’t downloads CAOS for Analytics yet, download it here or directly from the ‘Plugins’ > ‘Add New’-screen in your WordPress admin-area.

Configure CAOS for Analytics with Cookie Notice for GDPR
Configure CAOS for Analytics with Cookie Notice for GDPR
  1. Open the ‘Settings‘-menu and click on ‘Optimize Analytics‘ to open CAOS’ configuration screen.
  2. Select the value ‘When cookie has a value‘ in the ‘Allow tracking…‘-section.
  3. In the field named ‘Cookie name‘ enter ‘cookie_notice_accepted‘. This is the name of the cookie generated by Cookie Notice for GDPR once a user clicked the ‘Approve‘-button.
  4. In the field named ‘Cookie value‘ enter ‘true‘. This is the value the plugin sets the cookie to, once the user approves your cookie notice.
  5. Enter a value in the ‘Cookie expiry period‘-field. I use ‘30‘, since I don’t think I can keep following you around for more than a month. It’s okay to enter nothing, the settings defaults to a session cookie. Which means cookies are flushed the moment the user leaves your website.
  6. Press ‘Save Changes‘ and if you use any caching-plugins, make sure you flush your cache.

That’s it! You’re done. You’ve now configured CAOS for Analytics with a cookie notice to be fully compliant with GDPR. Enjoy!

Buy me a beer?

Do you appreciate my work and support? Please consider supporting me by donating, so I can continue to develop and write useful solutions for you.

Choose amount

Personal Message

Thank you! 🙂

Written by Daan van den Bergh

Magento 2 Back-end Developer with a passion for trainlifting, airplane-gliding, hunting trees and creating fake hobbies.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.