Cookie consent throught code.

Posted in: Newspaper
Post count: 16

I created a simple looking cookie consent through Cookie consent osano and it wants me to paste snippets before </head> and </body>. I found </head> in header.php but wasn’t able to locate the </body> tag in theme file.
Can you please help me fix that.

  • +NO, I don’t want to use any cookie plugins.

Code to be pasted before </header>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />

Code to be pasted before </body>

<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<script>
window.cookieconsent.initialise({
  "palette": {
    "popup": {
      "background": "#efefef",
      "text": "#404040"
    },
    "button": {
      "background": "#8ec760",
      "text": "#ffffff"
    }
  },
  "theme": "edgeless",
  "position": "bottom-left",
  "content": {
    "href": "https://www.investingsimple.com/privacy-policy/"
  }
});
</script>
  • This topic was modified 6 years by IS.
Post count: 35449

Hi,

Is no need to set the code inside the theme files, because this will be overwrite when you’ll make a theme update, you can set this code inside the theme panel in Analytics section -> https://www.screencast.com/t/kLRBKcjnlj

Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.