# ページヘッダーの先頭にスクリプトを追加する方法

**URL:** <https://meta.discourse.org/t/how-to-add-a-script-at-the-beginning-of-page-header/211513>\
**Category:** Product Support\
**Created:** [2021 年 12 月 8 日午後 4:41 UTC](https://meta.discourse.org/t/how-to-add-a-script-at-the-beginning-of-page-header/211513 "2021-12-08T16:41:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cocococosti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cocococosti/32/231474_2.png) [@cocococosti](https://meta.discourse.org/u/cocococosti)\
**Post date:** [2021 年 12 月 10 日午後 7:22 UTC](https://meta.discourse.org/t/how-to-add-a-script-at-the-beginning-of-page-header/211513/2 "2021-12-10T19:22:15Z")

</div>

こんにちは @SchweizerSchoggi さん。サイトに[consentmanager.net](http://consentmanager.net)のCookie同意バナーを追加してテストしたところ、「Semi-automatic blocking」タブのスクリプトを使用した場合、正常に動作しました。

 ![Screen Shot 2021-12-10 at 15.18.04](https://global.discourse-cdn.com/meta/original/3X/e/3/e3be806440962e8f4878aaf5381c311ab3a9c98d.png)

別のコードを使用すると、サイト全体がブロックされてしまいます。カスタムJavaScriptを使用してスクリプトを挿入することで解決できるかもしれませんが、他のコードスニペットを使用する方が簡単です。

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-a-script-at-the-beginning-of-page-header/211513)._
