> For the complete documentation index, see [llms.txt](https://docs.wicle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wicle.io/other/troubleshoot/tag/check-csp.md).

# CSPによりタグがブロックされていないか確認する

CSPによるWicleタグの読み込み・データ送信のブロックを確認し、サイト管理者への設定確認依頼と変更後のイベント送信確認を行う方法です。

サイトにContent Security Policy（CSP）が設定されている場合、Wicleの計測タグやデータ送信がブロックされることがあります。

## 症状 <a href="#symptoms" id="symptoms"></a>

* タグは設置されているが、イベントが送信されない
* ブラウザのコンソールに以下のようなエラーが表示される

```
Refused to load the script 'https://cdn-edge.karte.io/...' because it violates the following Content Security Policy directive: "script-src ..."
```

```
Refused to connect to 'https://....karte.io/...' because it violates the following Content Security Policy directive: "connect-src ..."
```

## 確認方法 <a href="#how-to-check" id="how-to-check"></a>

1. Google Chromeのデベロッパーツールを開く（右クリック →「検証」）
2. 「Console」タブを開く
3. `Refused` や `Content Security Policy` で検索する
4. `karte.io` や `wicle.io` を含むエラーが表示されていないか確認する

## 対応方法 <a href="#how-to-fix" id="how-to-fix"></a>

サイトの管理者に、エラーメッセージで示されたURLとディレクティブ（`script-src`、`connect-src`など）を伝え、CSP設定を確認してもらいます。Wicleで必要な設定は、[計測タグの設置 - Content Security Policyについて](/initial-setting/tag.md#content-security-policy)をご覧ください。

既存のCSPとサイトのセキュリティ要件によって、必要な変更は異なります。設定の変更後は、対象ページでWicleが動作することを確認してください。

## CSPの設定変更後の確認 <a href="#after-fix" id="after-fix"></a>

1. CSPの設定を変更後、対象ページを再読み込みする
2. コンソールに Wicleに関するCSPエラーが表示されなくなったことを確認する
3. [Chrome拡張のイベントビューア](/chrome-extension/event-viewer.md)でイベントが送信されていることを確認する


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.wicle.io/other/troubleshoot/tag/check-csp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
