# Content Security Policy（CSP）にエラーが出た場合

サイトにタグを設置し[発火の確認](https://helps.ptengine.com/faq/start-guide/check-tag-firing)をした際に Content Security Policy（CSP）のエラーが出た場合、こちらの記事を参照いただき、ホワイトリストに Ptengine のドメインを追加してください。

エラー画面

<figure><img src="/files/4UcKfw3BmvYVDYhUcduL" alt="CSPエラー画面（コンソール）"><figcaption></figcaption></figure>

<figure><img src="/files/l1OBXgYqmrcd5wRSnGRt" alt="CSPエラー画面（ネットワークタブ）"><figcaption></figcaption></figure>

## `default-src` のみ設定している場合 <a href="#default-src" id="default-src"></a>

`unsafe-inline`、`*.ptengine.jp`、`*.ptengine.com` の3つが必要です。

```
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' *.ptengine.jp *.ptengine.com">
```

## メディア毎に CSP を設定している場合 <a href="#per-media" id="per-media"></a>

以下のテーブルを参考してください。

| メディア        | ポリシー                                                  |
| ----------- | ----------------------------------------------------- |
| script-src  | `'self' 'unsafe-inline' *.ptengine.jp *.ptengine.com` |
| style-src   | `'self' 'unsafe-inline' *.ptengine.jp *.ptengine.com` |
| connect-src | `*.ptengine.jp *.ptengine.com`                        |
| img-src     | `*.ptengine.jp *.ptengine.com`                        |
| frame-src   | `*.ptengine.jp *.ptengine.com`                        |

```
<meta http-equiv="Content-Security-Policy" content="default-src 'self' *.mydomain.com; script-src 'self' 'unsafe-inline' *.ptengine.jp *.ptengine.com; style-src 'self' 'unsafe-inline' *.ptengine.jp *.ptengine.com; connect-src 'self' wss://*.mydomain.com *.ptengine.jp *.ptengine.com; img-src 'self' *.ptengine.jp *.ptengine.com; font-src 'self' * data:; frame-src 'self' *.ptengine.jp; worker-src 'self' blob:">
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helps.ptengine.com/faq/others/csp-policy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
