I have the following that i need to add to all drupal pages of a website:
<script type="text/javascript">
var __cs = __cs || [];
__cs.push(["setCsAccount", "code"]);
</script>
<script type="text/javascript" async src="https://...cs.min.js"></script>
I tried to add it to one of the themes i have as a library by using
(function ($) {
Drupal.behaviors.myModuleBehavior = {
attach: function (contect, settings) {
document.write('<script type="text/javascript">...</script>');
}
}
})
But nothing happened, there is another theme in the website with the following files
I'm not sure I'm going on at it in the correct way since i'm new to drupal but the most important thing to me is that i prefer not to add any modules or outside libraries to the website
Override the html.html.twig of whatever theme your theme is inheriting from and just put your javascript in the head section.