jhvanderschee / hugocodex

A website for front-end developers who want to learn Hugo.
http://hugocodex.org
22 stars 11 forks source link

Cookie Consent Popup Not Working As Intended #24

Open MikeFoden opened 11 months ago

MikeFoden commented 11 months ago

Based on https://hugocodex.org/add-ons/cookie-consent/#manage-consent linking to the main/layouts/partials/consent.html file, I've noticed the following:

I've tried this using the example provided (with a ga.js in my static/js folder) and it is loaded every time.

Threnklyn commented 2 weeks ago

hi, a cookie marked as is_functional always will be downloaded.

so using the example:

items:
  - title: Google Anaytics (functional)
    description: This code gives us insight into the number of people that visit our website, where they are from and what they are clicking on.
    is_functional: true
    script_file: ga.js
  - title: Crisp chat
    description: This code gives users the option to chat directly with us through a chat box in the bottom right corner.
    is_functional: false
    script_file: crisp.js

will load ga.js but not crisp.js. crisp.js will only be loaded if approved. So afaik it works as intended