# オプトインの設定

Wicleの計測タグによる計測をユーザーの同意に基づき制御する方法です。

## CMP(Consent Management Platform) による制御 <a href="#cmp-control" id="cmp-control"></a>

各種ツールの設定方法に則り、設定を行なってください。

設定方法について不明点があればサポートまでご連絡ください。

## 実装による制御 <a href="#implementation-control" id="implementation-control"></a>

### タグ設定の変更 <a href="#tag-setting" id="tag-setting"></a>

プロジェクト設定画面の「計測タグ」で、`基本設定 > オプトインモードを有効化`をONにし保存してください。

<figure><img src="/files/R6JQlKlyAex0LceIaBxd" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
ONにした時点から全計測がデフォルトで開始されない状態になります。

下記のアプリケーション実装を行い、テスト環境プロジェクトなどで動作確認ができた後にONにしてください。
{% endhint %}

### アプリケーション実装 <a href="#application-implementation" id="application-implementation"></a>

下記2のJavaScript APIから計測の制御ができます。

* `krt.allow()`
  * ユーザーの同意意思に基づき、計測を開始
* `krt.deny()`
  * ユーザーの拒否意思に基づき、計測を停止

{% hint style="danger" %}
上記APIの実行しても **同意状態をタグ側では保持しません。**

つまり計測タグが埋め込まれた全ページで、同意している状態であれば `krt.allow()` を実行していただく必要があります。(denyは明示的に実行する必要はありません)
{% endhint %}


---

# 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://docs.wicle.io/other/opt-in.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.
