Goodmorning,
I want to add a script from cookiebot in the header via funtions php but I get an error code every time I try.
Can you help me adding this code?
<script id=”Cookiebot” src=”https://consent.cookiebot.com/uc.js” data-cbid=”c0b4bd7c-2476-4827-bd09-50f952e1a7be” data-blockingmode=”auto” type=”text/javascript”></script>
Thanks!
Hey Dijkhuis,
Can you try adding this code at the bottom of your child theme’s functions.php:
function custom_script_name(){
?>
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="c0b4bd7c-2476-4827-bd09-50f952e1a7be" data-blockingmode="auto" type="text/javascript"></script>
<?php
}
add_action('wp_head', 'custom_script_name');
Best regards,
Nikko
Hi Nikko, thank you but it is not working:. syntax error, unexpected ‘?’
Is it possible for you to log in and try and make it work?
I tried several things but unfortunately can not fix it.
Hi Dijkhuis,
I’m getting this when I try to check the link you gave:
This site can’t be reached
eerselsmooistewebdesign.nl’s server IP address could not be found.
Can you put all the code in your child theme’s functions.php (including the code I gave) to https://pastebin.com/ and post the link here.
Best regards,
Nikko