Hi

I did have CookieHub installed on the website but the latetst scan says it cannot detect an installation.

I can't remember how I installed it last time (2+ years ago?).

The code I need in the header is:
<script src="https://cdn.cookiehub.eu/c2/21a70f05.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
var cpm = {};
window.cookiehub.load(cpm);
});
</script>
 

Can someone point me in the right direction please?

 

Comments

Need to find a place where the code is located or place the code?

If the second,

create a custom block /admin/structure/block

paste the code into it,

place the block anywhere on the page /admin/structure/layouts/manage/default

(I think footer is more appropriate).

If the first, see the source code.

It would be nice to find the code if it still exists but I'm assuming it got overwritten by a system update.

Placement. CookieHub says:
Paste this code to your website above all other scripts in the <head> section.

I have created the block and placed it in the header section of the default layout (Harris Flexible) above the other blocks and saved the layout. Reloading the page and checking the page source, I cannot find the cookie script.

Perhaps I'm misunderstanding.?

 

 

If you used the Raw HTML format to enter the code, correct Layout, you may need to clear the cache

/admin/config/development/performance

and everything should be fine.

Use the browser developer tool (F12) to find your block on the page and check its content.

You can also insert scripts directly into the PHP page template, but in the case of custom blocks they are easier to manage, given that they do not have to be inserted into the HEAD, as the “vendor” insists.