# 特定の要素でクリックイベントが発生しない場合

Wicleのクリック自動計測は、すべての要素を対象としているわけではありません。クリックイベントが発生しない場合は、以下を確認してください。

## 自動計測の対象要素 <a href="#auto-tracking-targets" id="auto-tracking-targets"></a>

デフォルトで自動計測されるのは、以下の要素のクリックのみです。

* `<a>` 要素
* `<button>` 要素
* `<input>` 要素のうち、type属性が以下のもの
  * `button`, `checkbox`, `image`, `radio`, `range`, `reset`, `submit`

上記以外の要素（`<div>`, `<span>`, `<li>` など）のクリックは、デフォルトでは計測されません。

## 対象外の要素でクリックを計測する方法 <a href="#extend-targets" id="extend-targets"></a>

対象外の要素のクリックを計測するには、以下の方法があります。

### 方法1: CSSセレクターで追加する <a href="#css-selector" id="css-selector"></a>

[プロジェクト設定の計測タグ画面](https://app.wicle.io/settings/mesurement-tag)から、クリック計測対象をCSSセレクターで追加できます。

### 方法2: HTML属性で追加する <a href="#data-attribute" id="data-attribute"></a>

対象とする要素に `data-wicle-auto-click` 属性を付与することで、その要素のクリックが計測対象になります。

```html
<div data-wicle-auto-click>この要素のクリックが計測されます</div>
```

### 方法3: 任意のdata属性で追加する <a href="#custom-data-attribute" id="custom-data-attribute"></a>

既にトラッキング用のdata属性を使用している場合、[計測タグ設定画面](https://app.wicle.io/settings/mesurement-tag)の「追加対象data属性」で指定することで、そのdata属性を持つ要素のクリックを計測対象にできます。

詳しくは[クリックイベントの拡張](/data-setting/event-tracking/click-event-extension.md)をご参照ください。

## 計測サポート外のケース <a href="#unsupported" id="unsupported"></a>

以下の要素内のクリックは、仕様上計測できません。

* [iframe](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)内の要素

## 除外設定に該当していないか確認する <a href="#check-exclusion" id="check-exclusion"></a>

計測対象の要素であっても、除外設定に該当するとクリックイベントは送信されません。

* [計測タグ設定画面](https://app.wicle.io/settings/mesurement-tag)で「除外CSSセレクター」や「除外対象data属性」が設定されていないか確認する
* 対象要素やその親要素に `data-wicle-system` 属性が付与されていないか確認する（この属性を持つ要素はシステムにより自動的に除外されます）

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

[Chrome拡張のイベントビューア](/chrome-extension/event-viewer.md)で、対象要素をクリックした際にclickイベントが表示されるか確認してください。

{% hint style="info" %}
クリックイベントには任意のデータを付与することもできます。詳しくは[クリックイベントの拡張](/data-setting/event-tracking/click-event-extension.md)をご参照ください。
{% 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/troubleshoot/tag/check-click-event.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.
