Cookie policy plugin?

Im having to include this stupid cookie policy on my site. You know, those popular popups that everyone likes so much…
Is there a GRAV plugin with which you can embed a cookie banner legally compliant (EU) on the website?
It would be best if you could get GRAV totally cookie free, is that possible? Also for all plugins?
I would have to block the cookies from Google Adsense, as well as all GRAV’s own.

Did you at least try to search for a plugin?

Hi Karmalakas, I installed the Cookie Consent v0.4.0 addon and entered the texts for the message in the settings. But no cookie popup opens on my website. Besides, the cookies from Google Adsense would also have to be blocked. Is that even possible with this plugin?

I use cookie consent on multiple sites and didn’t have issue :thinking: Just checked on incognito and it shows popup. Maybe some CSS could be missing and popup is simply not visible?

I don’t think you can opt-out using this specific plugin, but you can add a link on your cookie policy page - Google Analytics Opt-out Browser Add-on Download Page
I think I saw some other plugin offering this out of the box, but not sure now

I am an idiot. I have installed the browser addon “Don’t ask me for cookies” :slight_smile: It works!
But do not think you can block Google Adsense cookies with it?

As I said, it doesn’t block anything. It’s just a banner message to inform user that cookies are used. Provide users a link to opt-out themselves if they wish.

Hello Karmalakas,
thanks for the info. I guess there is no special plugin for GRAV for an opt-out solution.
When calling a page, the visitor may not be set cookies, only if he has confirmed with the popup with O.K.

Did you read my answers? Sorry, I’m not that patient as @pamtbaau :thinking: :smiley: I already pointed out where to find a plugin, but if you didn’t check what each of them offers, then maybe you don’t need opt-out feature that much :confused:

I think we are talking at cross purposes.
I am not looking for a plugin for the browser, but one for the website.
This plugin should suppress cookies for each visitor, or save them only after clicking “Accept”.
It’s about this stupid EU directive, which requires these annoying popups.

Could you please show at least one website which does that?

All websites I’ve seen either inform they use cookies and it’s your choice to leave, or they also allow to opt-out as an option from some vendors (not even all). Never saw a website which wouldn’t use at least essential cookies. And thats enough to comply with that EU directive.

One of Grav plugins claims it lets users opt-out. Not sure where you saw me linking to browser plugins :thinking:

@Henning007, It seems I’m a bit more curious then you are, so I decided to do some research on the web and have a look into the different Grav plugins.

Most plugins are wrappers around an existing open source library. For example Osano Cookie Consent library. These libraries can of course also be added to the site manually and extended.

Quick review of plugins:
Based on the README’s of plugins and a quick installation and review:

  • Simple Cookie: Creates a banner to inform the user that cookies are being used.
  • Cookie Consent: Creates a banner to inform the user that cookies are being used. (If one gets it to work…)
  • Cookies Notice: Creates a banner to inform the user that cookies are being used.
    Is very old and does not integrate with GPM and Admin…
  • TecArt Cookie Manager: The only real Cookie Manager that manages cookies and scripts.
    • notification only,
    • opt-in and
    • opt-out.

TecArt Cookie Manager:
If you want opt-in/opt-out, you first create cookie categories (for example essential, analytics, marketing, 3th party), then you attach to these categories the script(s) that provide the functionality belonging to each category.

Example of opt-in for Google Analytics/Google Tag Manager:

  • In the Banner tab, configure how the dialog should look like, eg. position, colors, buttons, etc.
  • Then you create category ‘Analytics’ in the Categories tab
  • In Scripts tab, you attach to the category the GA/GTM script that you would normally add to the <head> of the page.
  • Remove GA/GTM script from /user/themes/…/templates/partials/base.html.twig

When user enters the site, no GA/GTM script is added to the DOM and no cookies are being created. A dialog is launched and the user can choose to allow all, allow only essentials, or pick which categories to allow/deny. Then only the scripts belonging to categories that are allowed are added to the DOM and cookies/scripts of others categories are removed from the DOM.

Unfortunately, the plugin is not very well documented and it comes with Exceptions. Also, on the configuration side, it is not well translated, so you need to understand German a bit while working in Admin. The owner has not yet responded to pull requests (from Oct 2021) which fix these issues. There are more issues though, but when you fix these, it seems to be working properly.

Yes, I will happily leave any issues that need to be fixed up to you…

UPDATE 28/2:

  • Outstanding issues/pull-requests have been responded to.
  • New release has been created and will soon be available via GPM

Hi @pamtbaau,

I have answerded the issues on github and responded to pull requests yet.

Have a look at the plugins admin pages and try out the possibilites. It will be self explaining shortly. The content from the script tab is automatically wrapped in a “script” or “noscript” tag and the plugin adds this tag automatically to DOM.

You can also choose whether the element should be added to “head” tag, after opening “body” tag or before closing “body” tag.

A working example you could find on

Hello pamtbaau,
Thank you for your help. I will have the Cookie Police Tool installed by a professional on Upwork.
Or is there anyone here interested?
The regulations in the EU are to puke.
hardly believes one is one fertif, comes the next law. Above all it is annoying for the website visitors to click away every time a popup.

Hello @pamtbaau and thanks for your detailed information.
I have this problem, a few years ago I did a website for a relative that rents a few small vacation apartments; his website has 11 buttons that connect to an external booking service, like this iframe that I placed inside the md file for each apartment page:

<iframe markdown="1" src="" style="width: 400px; height: 355px; border: 0" frameborder=0 allowtransparency="allowtransparency">Tu navegador no soporta iframes</iframe>

so his website shows:

  1. the grav cookie (grav-site)
  2. the PHPSESSID from third party (11 iframes on body of several pages)
  3. the youtube session cookie YSC
  4. the youtube VISITOR_INFO1_LIVE (6 months)
    (3 and 4 = are of embed youtube videos)

I already installed TecArt Cookie Manager: in a test instance of his Grav installation. My question is: how can I prevent to run all these cookies before prior consent or cookie setup?, given the fact that they are not in header or footer, they are in the middle of the body spread on several pages with different codes for each iframe, a different 5 digit number code.
Thanks in advance for your appreciated advise.

@joejac, I’m putting @christiana83 from Tecart in de CC. She is the dev of this plugin.

Hi @joejac ,

you can choose the position where your script should be included - whether in “head”, "after openening “body” tag or before closing “body” tag.

A Script can be loaded with timeout

And a Script can be loaded on first page scroll.


You can also choose if the code should be wrapped in a “script” or a “noscript” tag.

In next release the plugin will be extended by loading script only on special pages.


Thanks @christiana83